PDA

View Full Version : سوال: معادل کد زیردر linq



Iran58
چهارشنبه 15 آذر 1391, 19:22 عصر
public DataTable SelFormInRole(string UserName)
{
DataSet ds = new DataSet();
SqlConnection cnn = new SqlConnection(Framework.Utility.GetStrCnn());
cnn.Open();
SqlCommand cmd = new SqlCommand("Sel_All_UserForms", cnn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@UserName", UserName);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(ds, "Forms");

cnn.Close();
return ds.Tables[0];
}