|
using sytem.oledb;
using system.windows.forms;
oledbconnection connect=new oledbconnection;
oledbcommand command=new oledbbcommand("Select 'field_name' from 'tabel' where 'condition'", connect);
oledbreader reader=command.executeReader();
reader.read();
{
combobox1.items.add(reader[0].tostring());
}
reader.close();
connect.close();
|
|
|
|
|
using sytem.oledb;
using system.windows.forms;
oledbconnection connect=new oledbconnection;
oledbcommand command=new oledbbcommand("Select 'field_name' from 'tabel'
***There are only two fields. ID & FilterKey and Im using FilterKey
so no need for where *****
where 'condition'", connect);
oledbreader reader=command.executeReader();
reader.read();
{
combobox1.items.add(reader[0].tostring());
}
reader.close();
connect.close();
kagiso
|
|
|
|
|
Ok, its not taking the using system.Windows.forms;
and the combobox1.items.add(reader[0].tostring()); says its doesnot have a definition for Add.
Everything else was what I did before
kagiso
|
|
|
|
|
hi
if its a web application, it wont take windows.forms, and u wont get combobox control also....
in such case, use
" using system.web.ui.webcontrols; "
{
dropdownlist1.items.add(reader[0].tostring());
}
this will defenetely work
|
|
|
|
|
This should do it.I will keep you posted, jus have to configure my database
kagiso
|
|
|
|
|
Does anyone know why if i draw something using the Graphics class in a picturebox, and then shrink the screen, it disappears when i bring the form up again?
Mark.
|
|
|
|
|
Probably because you used the CreateGraphics method ( which is bad ) instead of catching a paint event ( which is good ). Once you're doing more than showing a pciture, the picturebox is useless, you should just put a panel on the screen for sizing, and handle it's paint event, draw the image yourself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I'm a self taught programmer and wondered if any commercial programming (or equiv experienced) could enlighten me to standards as far as the naming of variables/methods and program layout go.
I'm aware of the "methods start with capital letters (eg.MethodOne) and variables start with lower case (eg.variableOne).
I've been seeing alot of m_iXDimension though (just as example)... whats with the m_i bit? or is it just coincidence ive seen it in 3 programs ive looked at?
Any info on this or anything else helpful would be appreciated.
Mark.
|
|
|
|
|
The i is Hungarian notation, it means that it's an integer ( although n was more commonly used ). Microsoft stopped supporting it when the Hungarian it was named after ( Charles Simoni or something ? ) stopped working for them. The m means it's a member variable. In C#, it's more common to do the _ for a member variable, without the m.
The main thing is, what matters is that if you work with a team, you ask what *their* standard is. It matters not one jot if your member variables start with m or not, what does matter is that your code base is consistent.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi, does anyone know how to get kerning pairs from a font in WPF?
Thanks.
|
|
|
|
|
Hi!
i want to use table control in windows application but i couldnot find it, so i searched for it i found its dll from below link
http://www.codeproject.com/cs/miscctrl/TableControl.asp
i added it in my project ,now problem is that i can add row control and column control and then i can add any control in my table using table and column control but i couldnot add text directly in column control to be displayed in table
can anybody help me plz
thanx
|
|
|
|
|
You probably wanted to use a datagrid or a gridview.
If you're going to use a control from an article, ask about it in the forum under the article itself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello
There are two form i.e form1 and form2. There is a send button on the form1. when i click on send, it'll send a message that i m displaying on from2. form2 displays on the another system and form1 is on another system. Application is running on both the system. At form2, there is a reply button. Now i want to show form1 which is in system tray on both the system, when i click on reply.
Thanks
Devesh Mishra
|
|
|
|
|
You are posting same question again after <3h.
A question which was missunderstood from nearely everybody (including me), ecxept Christian Graus, because it is malformed!
Christian gave you a good advice whcih you ignored!
Again, I can't believe this is happening!
Stop beeing rude!
All the best,
Martin
|
|
|
|
|
OK, as someone else said, I told you what you needed to do, and you ignored me and just reposted the question. http://www.codeproject.com/info/search.asp?cats=3&cats=6&searchkw=chat&Submit1=Search&author=&sd=15+Nov+1999&ed=30+May+2007[^]
Took me 2 minutes, and I see at least three articles on what you want to do.
I recommend if you want to become a developer, that you abandon this project, and instead learn some basic skills, both in C#, and in terms of being able to use google. On the other hand, if you want to impress people by showing them code you copied off the web and don't understand, just keep doing what you're doing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for all tha info..
and its not like that what u r saying that i hav ignored u...
Thanks a lot...
Devesh Mishra
|
|
|
|
|
Hello everyone,
I have a ComboBox which has got the following properties:
this.comboBoxFilterByCategory.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;<br />
this.comboBoxFilterByCategory.FormattingEnabled = true;<br />
this.comboBoxFilterByCategory.ItemHeight = 13;<br />
this.comboBoxFilterByCategory.Items.AddRange(new object[] {<br />
"--------------- All ---------------",<br />
"Books, Music & Movies",<br />
"Kids & Toys",<br />
"Sports & Fitness",<br />
"Tools & Automotive"});<br />
this.comboBoxFilterByCategory.SelectedItem = "--------------- All ---------------";<br />
this.comboBoxFilterByCategory.Location = new System.Drawing.Point(136, 40);<br />
this.comboBoxFilterByCategory.Name = "comboBoxFilterByCategory";<br />
this.comboBoxFilterByCategory.Size = new System.Drawing.Size(150, 21);<br />
this.comboBoxFilterByCategory.TabIndex = 26;<br />
this.comboBoxFilterByCategory.SelectedValueChanged += new System.EventHandler(this.comboBoxFilterByCategory_SelectedValueChanged);
I wish to disable the ComboBox so the user can only select from the options. This works just fine for sometimes then all of the sudden the line
this.comboBoxFilterByCategory.SelectedItem = "--------------- All ---------------";
gets disppears for no particular reason!!! Then I write the line once again and I am back to sqaure one. Things are back to normal till in a random fashion this line gets disappear.
I know this sounds strange, but anyone knows what is going on?!
Thank you very much and have a great day.
Khoramdin
|
|
|
|
|
Khoramdin wrote: comboBoxFilterByCategory_SelectedValueChanged
What does this code do ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
Looks like you are modifying the designer generated code InitializeComponent().
This is a bad idea and can have the effect you just discriped.
All the best,
Martin
|
|
|
|
|
Hi All,
I have been using C# for a couple of months now and am reasonably comfortable with it. Now, I have come across the need for an (for lack of a better name for it...) inline context menu. Perhaps some code would help describe my problem:
<br />
objects = DoSomeStuff();<br />
response = contextMenu1.Show();
DoSomeOtherStuff(response, objects);<br />
Basically, I need to get some input from a user via a standard context menu and then go back and resume execution of the routine which instantiated the said context menu. I could implement this using the standard event-based model, but the problem would be that I would lose local routine-level data (objects in the example above) unless I save 'em in private data members (which I want to avoid doing especially when it is used only in one place).
Anyone have any ideas?
Thanks!
|
|
|
|
|
i need to customize my color dialog box according to my application requirement.I need to change the background Color of dialog box, which i m able to do tracing the window messages and overriding the hook proc. But the exisisting prob is when i move the dialog box out of the scope of the desktop it gets repaint with all dialog control getting painted.
Regards
Nitin Goel
|
|
|
|
|
|
i have already been through this article, but still was not able to overcome my prob.
Actually i m able to paint the dialog by catching the WM_PAINT message , but the prob is that when i move the dialog box out of the scope of the Desktop window or open another application and then minimize that the dialog is not able to repaint it properly, this is probably bcoz of the message sequence that are being sent.
|
|
|
|
|
You need to catch the Paint event if you're going to change how it's painted.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i get datas serialport than i try to send datas from computer to outside so shows I/O debug error.what is it s reason?
|
|
|
|