请大家帮我看一下,我段代码为什么错,又何改正,谢谢
string CONNECTIONSTRING="uid=sa;pwd=sa;server=MyServer;database=pubs;"://正确
string strSql="select * from authors";//正确
SqlConnection connWorking = new SqlConnection(CONNECTIONSTRING);
SqlDataAdapter daWorking = new SqlDataAdapter(strSql,connWorking);
SqlCommandBuilder cbWorking = new SqlCommandBuilder(daWorking);
try
{
// Open a connection to the database
connWorking.Open();
// Call the update method on the dataset, this will
// make the appropriate insert, updates and deletes
//为什么会在下面出错!请帮忙,谢谢!
daAuthors.DeleteCommand = cbWorking.GetDeleteCommand();
daAuthors.InsertCommand = cbWorking.GetInsertCommand();
daAuthors.UpdateCommand = cbWorking.GetUpdateCommand();
}
catch(Exception ee)
{
return false;
}