protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SqlConnection conGet = new SqlConnection(DataBase.ConnectionString); try { SqlCommand cmdGet = new SqlCommand("SELECT LocalPageText FROM LocalPages WHERE (LocalPageName = 'ContactUS')", conGet); SqlDataAdapter daGet = new SqlDataAdapter(cmdGet); DataSet dsGet = new DataSet(); daGet.Fill(dsGet); ContactLiteral.Text = dsGet.Tables[0].Rows[0]["LocalPageText"].ToString(); } catch (SqlException) { } finally { conGet.Close(); } } }
try { SqlCommand cmd = new SqlCommand(); cmd = new SqlCommand("selectCourses", con); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader sqlReader = cmd.ExecuteReader(); DataTable dt = new DataTable(); dt.Load(sqlReader); GridView1.DataBind(); con.Close(); cmd.Dispose(); } catch { } finally { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)