sql数据库函数val不可识别
我要实现的功能是 取出supportID为1的所有行集合中的goodsN文本字段中的最大值,系统调试时提示val是不可识别的函数,请问各位大大如何解决
SqlConnection conn;
conn = new SqlConnection("Server=localhost; Uid=sa;pwd=sa; database=byproduct");
conn.Open();
//insert sql
string chek = "select max(Conversion.Val(goodsN)) as b from table where supportID ="1"";
SqlDataAdapter dk = new SqlDataAdapter();
dk.SelectCommand = new SqlCommand();
dk.SelectCommand.Connection = conn;
dk.SelectCommand.CommandText = chek;
DataSet myDataset = new DataSet();
dk.Fill(myDataset, "table");
string hh = myDataset.Tables["SellingWaste_Info"].Rows[0]["b"].ToString().Trim();
------解决方案--------------------Tables[ "SellingWaste_Info "]
改为Tables[0]
------解决方案--------------------myDataset.Tables["table"].Rows[0]["b"]就可以呀