mmary
Mar 20th, 2007, 06:52 AM
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,'sdff@gmail.com','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
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,'sdff@gmail.com','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