|
You're welcome.
|
|
|
|
|
You can use ADO.NET to create database for the website, and then connect to it with the C# application.
or you can do someting that call "web service" - open new ASP.NET Web service in your Visual Stduio, there, you can define methods that after you can call to then with your C#.
after you finish define, go to the C# project, and then on the solution explorer->referance of the project click left mouse, click "Web referance", and look for your web service address, then you can use all the methods you defined.
Gindi Bar Yahav - Web & Software developer.
|
|
|
|
|
Hey my friends ...... I have a password text box(i.e PasswordCharacter='*') there is one check box which allows the user to see its password or just the star ....... I tried to change the value of the text boxes passwordCharacter(i.e txtbox1.PasswordCharacter='') but it says "it is not allowed to make empty" ... so how can I do that??
Thank you
|
|
|
|
|
matiIsGreat wrote: I tried to change the value of the text boxes passwordCharacter(i.e txtbox1.PasswordCharacter='') but it says "it is not allowed to make empty"
No, you can't have an empty character literal - unlike a string which has a variable length 0..n and thus can be empty, a character has a fixed size (16 bits). Use '\0' for a null character and it will do what you want. Or, use "UseSystemPasswordChar" instead of "PasswordChar".
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I read an article on Msdn about how to restrict users from setting focus to a specific cell in DataGridView , and I understood how it work , but what really I need to now is how to restrict users form set focus to a multiple cells and especially if two cells are exactly adjacent
for example if I have 4 columns in a DataGridView and and the columns to skip are 2nd and 3rd , so how can i do that
|
|
|
|
|
Take a look at How to: Make Columns Read-Only[^] on MSDN.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi Developers..
I need to print a text and images without using printer driver.
using c#.net
i really need it done any how..
thanking you
|
|
|
|
|
I hope you know exactly the commands you need to send to the printer to do what you want. You can bypass the printing system. There's an example in this KB article[^].
|
|
|
|
|
Dear Dave,
Thanks for your replay
I have already gone through the link you have given ..
actually I need to print image at the top, text and image at the bottom.
I dont know exact commands which i nee to send printer to print image and text
Thanking you,
|
|
|
|
|
Those ARE the commands you use to send the data. You need the know WHAT you're sending to the printer. What do you have to send to the printer to tell it how to render the text and image you want. This is NOT going to be done for you and the commands will be different for every printer. This stuff will be documented in the manual for the printer. If you don't have it, contact the manufacturer of the printer to get one. Without it, you have no hope of doing what you want.
|
|
|
|
|
Dear All, I have following code to run 10 thread at same time
for(byte i=0; i<10; i++)
{
Thread t=new Thread(new ThreadStart(runAction));
t.IsBackground=true;
}
void runAction()
{
if (InvokeRequired)
{
BeginInvoke(new run(runAction));
return;
}
}
If i uncomment the code Application.DoEvent() then it will give me the responsive interface, but also it starts the last action first, while i want to run them concurrnetly and then the second last and so on to first.
if i comment the code Application.DoEvent() then only one (first thread) runs and others are stack, like one finish then another start and so on.
I want to run thread concurrently and i would like have my UI working?
what is wrong with my code?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
You're not showing enough of the code. What is "run"? Is this code sitting on a form or in a seperate class?
Also, did you know that every thread you launch costs you 1MB of RAM and is an expensive operation? Is there any particular reason for doing this??
After all that, you're not launching the same operation on 10 seperate threads. Each of your threads is calling the same function ON THE UI THREAD. So it's not suprising that your UI is frozen during this time. All you did was launch the call on a background thread, which farmed out the work of "runAction" back to the UI thread.
You do the work in the background threads and then if they have any updates to the UI that need to be done, they can Invoke a method that does the update on the UI thread.
|
|
|
|
|
Well, this is real code.
foreach(ListViewItem prv in des.lProvinces.CheckedItems)
{
if (prv.Text.Equals("All"))
continue;
pmuAccessPath=string.Format("{0}\\{1}\\NSPDatabase.mdb",des.DestinationFolder,prv.Text.Trim());
if (Directory.Exists(Path.GetDirectoryName(pmuAccessPath)))
Directory.Delete(Path.GetDirectoryName(pmuAccessPath),true);
Directory.CreateDirectory(Path.GetDirectoryName(pmuAccessPath));
if (!File.Exists(pmuAccessPath))
File.Copy(des.SourceAccessPath,pmuAccessPath);
Triplet triplet=new Triplet(prv.Text,pmuAccessPath,prv.Tag);
Thread t=new Thread(new ParameterizedThreadStart(runMultiple));
t.IsBackground=true;
t.Start((object)triplet);
}
delegate void run(object var);
void runMultiple(object varr)
{
if (InvokeRequired)
{
BeginInvoke(new run(runMultiple),varr);
return;
}
Triplet variables=varr as Triplet;
string prv=variables.First.ToString();
Finish fin=new Finish();
pnlControls.Controls.Add(fin);
fin.Dock=DockStyle.Top;
fin.lblProvince.Text=string.Format("Province : ({0})",prv);
fin.lblProvince.Refresh();
string query=string.Empty;
byte tableCount=43;
string pmuAccessPath=variables.Second.ToString();
int prvId=Convert.ToInt16(variables.Third.ToString());
}
based on my idea, all thread should run at same time, but in this case it doesent.as i told n msg that if i remove the code "Application.DoEvent()" the interface is totaly stack, but if i use that code then every thing is responsive, while my last action is done first and then it continues.
but bothering is that only one thread runs at atime, i can see running threads in progress bar.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
how to connect 9 pin serial port plug to itself so tha one can recive the data in the 2nd Pin andtransmit in 3rd pin.
I am not able to send or recive the data throuth 9 pin plug serial port.
|
|
|
|
|
Connect pin 2 to pin 3, and unless there is some hardware handshaking, it should work. If handshaking is used, then connect 7 to 8, then 6 to 1 and 4 if required. See here for pinout[^]
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I tried i am only able to recive but i am not able to write serial port.i mean i am not able tosend the data.Below is the code snip.
if (serialPort1.IsOpen == false)
{
this.serialPort1.Open();
}
this.serialPort1.Write("3F 50 52 40");
|
|
|
|
|
A couple of things:
1) Are you aware that
serialPort1.Write("3F 50 52 40"); will write 11 bytes, not 4?
2) Are you sure that you wired the connector the right way? The pin numbering is normally molded into the connector with a "1" beside pin one. If you are recieving ok, then you are presumably connected to something else as well, which would imply you have wired the connector wrong for loopback.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi,
if you need to test some serial port software, you can do so without requiring actual serial port hardware, by using virtual ports. Here[^] is an example for you; I used the com0com virtual driver successfully, it brings you a pair of virtual serial ports that seem connected by a null modem cable.
|
|
|
|
|
After writing to the serial port i am reciving an error of writing timed out i am using the HandShake Requestto send,I am not geting the problem
|
|
|
|
|
your statement isn't very clear; I think it tells me you are using hardware handshaking, and something is wrong with it. If the sender needs a permission to send, and the other party doesn't provide it, the sender is bound to time out (and if he were to ignore the lack of permission, the message would be lost as the other party will probably ignore it, being not ready to receive anything).
You might try with a very simple communication: no handshaking, and short messages, far apart. When that works, add handshaking. When that works, use any message length and frequency you want.
|
|
|
|
|
Judging by the timing of the messages, he isn't listening to anything anyone is saying. I think he's looking for a simple code fix and doesn't really have any hardware attched to the port at all, nor does he have the virtual COM ports you suggested installed.
|
|
|
|
|
Dave Kreskowiak wrote: he isn't listening to anything anyone is saying
Yeah. I have seen such pattern of behavior before, mostly in people from one and the same country. Writing is good, however I wish the would learn to read and interact too.
|
|
|
|
|
Hi.
As people have said, don't use hardware handshaking if you don't have to. It's harder to use hardware handshaking. But, it prevents buffer overruns. As people know, Windows is not a real-time OS. Hardware handshaking is much faster than using a higher level software implementation. In some cases, you can not tolerate a buffer overrun, and you want to use the fastest way you can. Serial communication is semi-slow to begin with.
You'll need to make sure that the correct signals are connected in the cables. Most serial cables do not include the handshake signals! Also, you need to know the wiring of which pins on ConnectorA go to which pins on ConnectorB.
I strongly recommend that you get and use an RS232 breakout box! It'll save you a lot of time. Also, you should have at least a light logic probe that can handle the RS232 voltage levels that you're using. You can use a DVM (Voltmeter). There are a number of low-cost USB "logic analyzers" that can interpret RS232 signals. The handshaking signals would often be displayed separately. I'm not sure if the MSOs show/decode the RS232 handshake signals. I like the Tek MSOs the best.
This will help you get started with using RS232 handshaking:
http://www.google.com/search?q=rs232+hardware+handshaking[^]
http://www.google.com/search?q=rs232+breakout+box[^]
Good Luck!
______________
Joe
|
|
|
|
|
I know that the OP isn't in America. Still, low-cost USB Logic Analyzers that support RS232 decoding, check out ebay:
Business & Industrial > Electrical & Test Equipment > Test Equipment > Logic Analyzers
http://business.shop.ebay.com/Logic-Analyzers-/97231/i.html[^]
Here is the one that I use, and a number of other consultants use:
http://www.pctestinstruments.com/[^]
Note: The USB Logic Analyzers do not support doing a trigger on a specific data word. So, you would/could trigger the start bot of the RS232. The interpretation is done by post processing software. However, an MSO like the Teks, often support doing a trigger on a specific data word (e.g. trigger on RS232 data value of 0x43).
|
|
|
|
|
Hi this is to be done in c#. Please help
(Events)
1. Write a program which includes a class named Numbers, for which Print is a member function to print numbers 1 to n. When the number of elements printed becomes equal to n, an event is invoked to stop printing numbers, showing a message “Limit Exceeded”.
(Indexers)
2. Create a class Student with RegNo, Name & Marks. Include Indexer, Create 5 instances of Student, and display them.
(FileSystem)
3. Create a Windows application to select a file from the system and display its properties Name, Size, Dates etc
4. Create Windows Application to read from an existing file and write to a new file. There should be 2 radio buttons FileStream & Stream. If FileStream is selected the file reading and writing should be performed using FileStream and if Stream is selected file reaing and writing should be performed using StreamReader & StreamWriter.
5. Simulate a Notepad Application. (Hint: Use RichTextbox, Dialogbox controls, Classes from System.IO namespace etc.)
|
|
|
|
|