|
-
Mar 20th, 2007, 06:52 AM
#1
Thread Starter
Addicted Member
getting the value from mysql
hi to all,
i was created one table in my sql the query is
create table test(name varchar(50),age int,mailid varchar(50),phoneno varchar(50),remainder date)
i was inserting the record by using the following query
insert into test values('ssss',22,'[email protected]','54654765',3/23/2007)
when i am reading the value from mysql in c#.Net, it will give the error Unable to convert MySql date to System.datetime
the coding i have used is
clsGlobalFields.mysqlcon = new MySqlConnection("server=" + servername + ";port=" + strport + ";database=" + databasename + ";uid=" + struname + ";pwd=" + strpwd + ";");
mysqlcon.Open();
mysqlcmd = new MySqlCommand(select date from test , clsGlobalFields.mysqlcon);
mysqlreader=mysqlcmd.ExecuteReader();
while(mysqlreader.Read())
{
messagebox.show(mysqlreader[0].toString());
}
anybody know plz help me to solve the problem
thank u
With thanks and Regards
MMary
-
Mar 20th, 2007, 07:11 AM
#2
Re: getting the value from mysql
Please use the [code] or [highlight=c#] tags to post C# code in future, thanks.
Where have you declared mysqlreader?
-
Mar 21st, 2007, 02:04 AM
#3
Fanatic Member
Re: getting the value from mysql
There's no date column on your test table. If you want to select the date use "select now()"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|