|
defenently the same name...let's say i used the northwind database..and the categories table
this is the code:
private void Form1_Load(object sender, System.EventArgs e)
{
myserv.Service serv = new myserv.Service();
dataSet1=serv.GetNames();
dataSet2=serv.GetNames();
comboBox1.DataSource=dataSet1;
comboBox1.ValueMember="CategoryID";
comboBox1.DisplayMember="CategoryName";
}
i just can't avoid this error
rzvme
|
|
|
|
|
How do I connect to MySQL using C#?
What do I need to do so?
plz help me out ...!!!
I have never used MySQL before, all help is greatly appriciated.
phil chris
|
|
|
|
|
create DSN of ur database
System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection("DSN='dsn name'");
conn.Open();
rahul
|
|
|
|
|
They are also a MySqlconnector , search it on the mysql site
bye
|
|
|
|
|
Thanks for the help so far guys.
KnOw yAr Rol3,
phil chris
|
|
|
|
|
hello,
does anybody know how to determine the pixel width of a string if given the font and font size? i would like to be able to do this using c#, but i have no idea where to start.
thanks!!!
RC
|
|
|
|
|
You can probably look here -> [TextRenderer.MeasureText]
It's new to the .NET 2.0 framework according to MSDN website. There are examples in VB and C# about 3/4 of the way down the page.
Hope this gets you off in the right direction.
Mike Poz
|
|
|
|
|
Hello all,
I have just got this new HP Compaq nx6125 laptop which has a finger scanner which helps me to log into the computer. I was just thinking does anyone know how we can program the finger scanner to reconize the finger. In short how to i learn finger scanning programming...
I know its very hard... but if any one has any code or any directly i would really appreciate it a lot..
CH
|
|
|
|
|
I'm not sure where to begin, but I would say that C# probably isn't the right tool for the job. You're most likely going to have to work with device drivers in C, that'd be my suggestion of where to start looking, at least.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Goof around music jam with my brothers (with video)
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
hi! CP people!!
it's my first time to post a question here, but i tend to consult CP whenever i have programming problems.
my problem here is that i have two textboxes. one is read-only and the other one is not.
now, what i want to do here is to show what the user typed in the textbox which doesnt have the read-only property to the other textbox which is read-only.
i really don't know how to start the coding because it's only been a year since i'm learning C# .NET and my professor in C# doesnt help at all. i can assure you that is not a school project. i just want to learn from you guys rather than to consult my professor.
thanks in advance...
|
|
|
|
|
Hiya,
TextBox textBox1=new TextBox();
textBox1.KeyPress+=new KeyEventHandler(UpdateTextBox);
...
TextBox textBox2=new TextBox();
textBox2.ReadOnly=true;
...
private void UpdateTextBox(object sender,KeyEventArgs e)
{
textBox2.Text=textBox1.Text;
}
Even if textboxes are read-only to the user, .net still can write to it in code.
Hope this will do!
Graham
|
|
|
|
|
it helps logic wise. i tweak the codes a bit but thanks anyways.
Regards...;)
in land of the idiots, the imbecile is the king.
|
|
|
|
|
well u can do like this
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
textBox2.Text=textBox1.Text;
textBox2.ReadOnly=true;
}
it will help u
Yogesh_T
|
|
|
|
|
Hi there!
Please help, I am trying to show the data from an SQL select statement into textboxes.
Here is what I have so far:
SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=CB;Integrated Security=SSPI;");
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM tblCB WHERE CBID='"+ this.CBID.Text +"'", conn);
cmd.ExecuteNonQuery();
conn.Close();
sasa
|
|
|
|
|
Replace:
spatwa wrote: cmd.ExecuteNonQuery();
with:
using (SqlDataReader reader=cmd.ExecuteReader()) {
if (reader.HasRows) {
reader.Read();
textBox.Text=reader.GetString(reader.GetOrdinal("ColumnName"));
}
reader.Close();
}
|
|
|
|
|
Thanks a million Graham, I appreciate your help.
sasa
|
|
|
|
|
just need a little more help with my beginners project, please.
I have a large file in the following CSV format
"71415","535","200","5364564","0","0","0","0","0","0","0","0","0"
I have used the code from this article by dave'O
http://www.codeproject.com/cs/database/DataSetFrmDelimTxt.asp
to place the data in a datagrid.
Just wondering , What is the easiest way to strip out all the quotation marks during the parsing ?
Any help would be appreciated, thanks in advance.
Seem to be having problems as this character is used to denote a string.
|
|
|
|
|
string input=....
input=input.Replace('"','');
Graham
|
|
|
|
|
Thanks for that, my quotation marks are now all gone.
Just a little confused though, does this mean that ' can be used to enclose a string , as well as " . Also does
input=input.Replace('"','');
insert a blank space, or does it remove the character alltogether ?
Thanks for the assistance with this.
|
|
|
|
|
' can only be used to store a single character of type char. E.g.
char testChar='s';
Regarding input=input.Replace('"','');
It takes in a string, returns a new string where all the occurances of the first parameter are replaced by the second parameter. So in this case '"' (representing double quote char) is replaced by '' (empty char).
Graham.
[Edit: Just noticing that it's quite hard to tell two single quotes '' from a double quote " with the default browser's font. ]
-- modified at 17:46 Thursday 15th June, 2006
|
|
|
|
|
Thanks,
" Persistance alone is omnipotent" (Calvin Cooolidge)
|
|
|
|
|
is it possible for me to have hyper terminl running and i retrive any data that is recieved in the hyper termial port??????
or
is it possible for me to run hyper terminal from c# so i can access something through it???
kenny
|
|
|
|
|
Hi,
I want to make an application in C# for Windows XP, which could run in the background and log all the URL visited in any browser by any user.
Any ideas where to start?
Thanks
Code Monkey
-- modified at 18:36 Wednesday 14th June, 2006
|
|
|
|
|
Oh, that could be tricky to implement. Sounds like you need to periodically monitor the processes on the system for any browsers that might start. Perhaps using Process.GetProcesses() .
You would then need to hook into the browser some how, either using a plugin written for the browser, or hooking via the system using via P/Invoke and Win32.
Also this application sounds like it should be implemented as a Windows service, and using some sort of logging mechanism.
Good luck!
Graham.
|
|
|
|
|
Hi
I have main form with a button, which when pressed, displays a second form. I don't want this form modal, so I use Show(). But, I only ever want one instance of this form. My confusion, and I am a real C# / .NET newbie, is when / where / how this is created / destroyed. Here's what I am doing...pseudoish
MainForm.OnClickEvent(...)
{
if secondform == null
secondform = new form(data_for_form_listbox)
secondform.show()
}
secondform.onCloseBUtton(....)
{
Close(); //or should this be hide();//I want the C++ equiv of EndDialog / CloseWindow which will actually delete the instance
}
On the 'secondform' I have a close button, which, calls - 'Close()'. Does that destroy the window? I want it destroyed so my OnClickEvent will create a new instance, so my second form can refresh its data (via the ctor).
I don't need code samples just a basic step by step of where I should create the second form / how I close it, (via teh second form), and should I destroy / recreate etc.
Does this make sense?
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|