Hello!
I was Coding a project wich connect and read something from sql database,
but
reader.GetString("exmple")
gets an error System.InvalidCastException ,
The Best overloaded method match for system.data.comman.dbdatareader.getstring(int) has some invalid arguments
-------------------------
any idea?
ty
I was Coding a project wich connect and read something from sql database,
PHP Code:
MsSQL my = new MsSQL("select * from TableExample");
using (System.Data.SqlClient.SqlDataReader reader = my.Read())
{
while (reader.Read())
{
accInformation acc = new accInformation();
Console.WriteLine(reader.GetString("User"));
acc.User = reader.GetString("User");
acc.password = reader.GetString("password");
acc.Name = reader.GetString("Name");
acc.Email = reader.GetString("Email");
acc.sex = reader.GetString("sex");
acc.address = reader.GetString("address");
acc.postcode = reader.GetString("postcode");
acc.phone = reader.GetString("phone");
acc.mobile = reader.GetString("mobile");
acc.reg_ip = reader.GetString("reg_ip");
Global.AccountList.Add(acc);
max++;
}
}
my.Close();
reader.GetString("exmple")
gets an error System.InvalidCastException ,
The Best overloaded method match for system.data.comman.dbdatareader.getstring(int) has some invalid arguments
-------------------------
any idea?
ty