In using sqlCommand class, I got the following error:
Error 1 The best overloaded method match for 'System.Data.SqlClient.SqlCommand.SqlCommand(string, System.Data.SqlClient.SqlConnection)' has some invalid arguments
all I am doing is initiating an object of class and sending connection info
string conn = ConfigurationManager.ConnectionStrings["MubarakConnectionString"].ConnectionString;
// 1. Instantiate a new command with a query and connection
string selectAgenciesSQL = "select * from [serverM1].[Agency]";
SqlCommand cmd = new SqlCommand("select * from [serverM1].[Agency]",
I do not know what is going on, I also tried
SqlCommand cmd = new SqlCommand(string selectAgenciesSQL,conn);
but i get the same error.
all this is runnning in the page load.
View Complete Post