J
Jeff
hi
asp.net 2.0
i've used connectionstrings like this one for my webproject:
connectionString="Server=Pdc1;Database=Testing;Integrated
Security=false;User ID=tester;Pwd=hardtoguesspwd;" />
But now I need to change to using odbc as the webhosting company only
support odbc. So from my understanding I need to change my
connectionstring - specify what odbc profile to use.
In addition I wonder if I need to change my code for accessing the database:
public List<Car> GetCars()
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("test_spGetCars", cn);
cmd.CommandType = CommandType.StoredProcedure;
cn.Open();
return GetCarCollectionFromReader(cmd.ExecuteReader());
}
}
(does that code looks okay for being used together with odbc?)
any suggestions?
asp.net 2.0
i've used connectionstrings like this one for my webproject:
connectionString="Server=Pdc1;Database=Testing;Integrated
Security=false;User ID=tester;Pwd=hardtoguesspwd;" />
But now I need to change to using odbc as the webhosting company only
support odbc. So from my understanding I need to change my
connectionstring - specify what odbc profile to use.
In addition I wonder if I need to change my code for accessing the database:
public List<Car> GetCars()
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("test_spGetCars", cn);
cmd.CommandType = CommandType.StoredProcedure;
cn.Open();
return GetCarCollectionFromReader(cmd.ExecuteReader());
}
}
(does that code looks okay for being used together with odbc?)
any suggestions?