Tuesday, January 26, 2010

Use Of Data table and Dataset

SqlCommand mySqlSelect = new SqlCommand(“select * from tbl_test where nid=’” + Session["nid"].ToString() + “‘ and sessionid=’” + Session["sid"].ToString() + “‘”, conn);
mySqlSelect.CommandType = CommandType.Text;
SqlDataAdapter mySqlAdapter = new SqlDataAdapter(mySqlSelect);
DataSet myDataSet = new DataSet();
// Convert DataSet to DataTable by getting DataTable at first zero-based index of DataTableCollection
DataTable dtr1 = myDataSet.Tables[0];

Action Method in Mvc

In this section, you will learn about the action method of controller class. All the public methods of a Controller class are called Act...