hello sir i want to display this code as entity base but execute scalar does not run in this case an error occur
i have also comment out the old code where i have tried in this case
so how they can execute
cs
public void Fill()
{
using (var ctx = new industryEntities1())
{
var studentName = ctx.tbl_licencel.SqlQuery("select max(user_id)+1 as user_id from tbl_licencel").ToList();
user_id.Text = ctx.ExecuteScalar().ToString();
}
//SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString);
//con.Open();
//SqlCommand cmd = new SqlCommand("select max(user_id)+1 as user_id from tbl_licencel", con);
//user_id.Text = cmd.ExecuteScalar().ToString();
//con.Close();
}