|
hi there
I am using SQL server and windows forms in C#. i have created a database using the tables and query. Now if i update the database manually, it works. what i would like to know is that i will be getting data over the serial port that will put into the databases. will it be possible to get the databases automatically updated? If yes, then how can i go about doing that?
Thanks in advance
|
|
|
|
|
Atmadarshini wrote: i will be getting data over the serial port that will put into the databases. will it be possible to get the databases automatically updated? If yes, then how can i go about doing that?
Your question was somewhat vague about what the actual problem is:
Do you need to know how to read the data from the serial port?
Do you have the data from the serial port but need to know how to interpret the data?
Do you want the database server to read the data coming from the serial port and it will update itself?
There is no automatic process to do any of the above, you will have to write some code to read the data from the serial port. You are going to have to interpret the data. If your application can do that then it can form the required commands to update the database.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi there
I have created a checklist form. in my checklist form, i have checkboxes and what i want to do is that when i tick on the checkboxes, i have a button that says generate report so when i click on this button, what happens is that another form pops up that contains labels related to the checkboxes wih messages. I manage to get to that part now the problem is that if i want to save them in a file or so, how do i do that so that i can have proof. the thing is that if i dont save them, the next time there will be different checkboxes ticked so i need to save them.
i was reading through the msdn library and i only came across how to save pictures and save text in a rich textbox but i need to if possible be able to generate a report kind of thing. How do i do that?
One last thing is that, is it possible to automate the checklist form in the sense that instead of me ticking the checkboxes, when something happens, the checkboxes are ticked on their own? how would io go about doing that as well?
I hope that i am explaining things properly.
All help will be highly appreciated.
Thanks in advance
|
|
|
|
|
Atmadarshini wrote: I manage to get to that part now the problem is that if i want to save them in a file or so, how do i do that so that i can have proof.
What sort of file ? Text, a graphic, or what ? Writing a text file in C# should be pretty easy to find info on with google.
Or do you mean you want to save info on what boxes were checked for use by your program ? If so, you can save the data as text, xml or in the registry.
Atmadarshini wrote: but i need to if possible be able to generate a report kind of thing.
A graphic report, or just text ?
Atmadarshini wrote: One last thing is that, is it possible to automate the checklist form in the sense that instead of me ticking the checkboxes, when something happens, the checkboxes are ticked on their own?
You can write code to iterate through the checkboxes and check them, or check specific ones.
Atmadarshini wrote: I hope that i am explaining things properly.
To be honest, I found your questions vague, please try to clarify, and I will elucidate further.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry if I am showing my ignorance - but how in C# do I easily determine the directory containing my executable? When executed via a File Association the Home Directory is that containing the file. Brad Bruce has supplied a C++ version (search articles for Program Directory), but I would like a C# version. Ta - Graham.
Pensioner Graham Dean
|
|
|
|
|
Sorry - found it further down in this forum:
Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "filename");
RTFM Graham!
Pensioner Graham Dean
|
|
|
|
|
i've crypted a file.
Then embedded in another application.
I want to open in MemoryStream the embedded crypted file, then decrypt it.
What i'm asking is, can i do it using only MemoryStream Files without transferring something on the Hard Disk?
Can i make write operations on MemoryStream files and just to use the new output before to close it? That is if i use FileStream i get all the write operations ended when i close the object, is it the same for MemoryStrem?
|
|
|
|
|
|
Here is a user define message in vc++ 6.0 dll, such as WM_USER.
How to delegate the event in C#?
|
|
|
|
|
Hi All,
I want to know how to implement push server architecture using .Net (C#).
|
|
|
|
|
Depends on what you wanna push...
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
I have a distributed client-server application and I want to add all my Binaries and Dlls on the server machine and in case of updating any file server machine will push this updates to clients machine,
i hope you can help me
|
|
|
|
|
Look at the MS Application Updater block.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
what do u mean by MS application updater and where can i find it
|
|
|
|
|
Google is your friend...
Click here[^]
|
|
|
|
|
Goooogle!
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
Have two listboxes lB1, lB2. lB1 is populated with several items.
When user clicks button (btn) the item selected from lB1 will be added to lB2.
A button (btn1) has the following code
***********************
string curItem = lB1.SelectedItem.ToString();
lB2.Items.Add(curItem);
****************************
This compiles fine, but get an error when click btn
ERROR
"Object Reference not set to an instance of an object."
Any help will be greatly appreciated
|
|
|
|
|
Have you tried stepping through the code?
Maybe you don't have any item selected in the first listbox when you click the button?
Matt Gerrans
|
|
|
|
|
This error will happen if you don't have anything selected, or at general the item is null .
"I am a lair" Is this statement true or false ?
|
|
|
|
|
The code works fine if I create the components via VS.NET but I cannot get it to work when I create the controls dynamically. I am sure an item is selected because it gets highlighted.
Here is the way I am doing it
\\code for button to create components
ListBox lB1 = new ListBox();
lB1.Location = new Point(8,24);
lB1.Items.Add("A");
lB1.Items.Add("B");
lB1.Items.Add("C");
ListBox lB2 = new ListBox();
lB2.Location = new Point(8,24);
\\button
Button btn1 = new Button();
btn1.Location = new Point(152,30);
btn1.Text="->";
btn1.Size = new System.Drawing.Size(40,23);
btn1.Click += new System.EventHandler(btn1_Click);
\\when bnt1 clicked
private void btn1_Click(object sender, System.EventArgs e)
{
string curItem = listBox1.SelectedItem.ToString();
listBox2.Items.Add(curItem);
}
|
|
|
|
|
Hi!
What's so difficult about the exception?
The runtime tells you that you're trying to access a null reference, so you better believe it!
I guess it's thrown on the line string curItem = listBox1.SelectedItem.ToString(); simply because you're creating ListBox es named lB1 and lB2 but are accessing listBox1 and listBox2 in your event handler.
mav
|
|
|
|
|
What about trying ?
private void btn1_Click(object sender, System.EventArgs e)
{
lB2.Items.Add(lB1.SelectedItem);
}
Also you have naming error, in lb1 and listBox1, and the same in lb2 // In the btn1_Click code.
"I am a lair" Is this statement true or false ?
|
|
|
|
|
I made a mistake when I posted the code. All references are made to lB1 and lB2 (not listBox1, listBox2).
Just like I said, code works fine when components are created using the visual interface.
I also tried
private void btn1_Click(object sender, System.EventArgs e)
{ lB2.Items.Add(lB1.SelectedItem);
}
still an error.
*****************************************
The code works fine if I create the components via VS.NET but I cannot get it to work when I create the controls dynamically. I am sure an item is selected because it gets highlighted.
Here is the way I am doing it
\\code for button to create components
ListBox lB1 = new ListBox();
lB1.Location = new Point(8,24);
lB1.Items.Add("A");
lB1.Items.Add("B");
lB1.Items.Add("C");
ListBox lB2 = new ListBox();
lB2.Location = new Point(8,24);
\\button
Button btn1 = new Button();
btn1.Location = new Point(152,30);
btn1.Text="->";
btn1.Size = new System.Drawing.Size(40,23);
btn1.Click += new System.EventHandler(btn1_Click);
\\when bnt1 clicked
private void btn1_Click(object sender, System.EventArgs e)
{
string curItem = lB11.SelectedItem.ToString();
lB2.Items.Add(curItem);
}
|
|
|
|
|
try :
private void btn1_Click(object sender, System.EventArgs e)
{
string curItem = lB11.SelectedItem.ToString();
lB2.Items.Insert(curItem);
}
"I am a lair" Is this statement true or false ?
|
|
|
|
|
When I step thru the code. it fails on this line
"string curItem = listBox1.SelectedItem.ToString();"
but I am 100% sure that an item is selected before coninueing.
-I tried the isert, same deal.
How do I trigger an event by just clicking on one of the items, may be I can try this instead of selecting item then click a buton.
THis %$^*)#@#@ is kicking my rear.
thnanks for all good adviced.
|
|
|
|
|