Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     using (SqlConnection cn = new SqlConnection(constr))
     {
         SqlCommand cmd = new SqlCommand("tiranes", cn);
         cmd.CommandType = CommandType.StoredProcedure;
         cn.Open();
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         DataSet        ds = new DataSet();
         da.Fill(ds);
         Detail.DataSource = ds;
         Detail.DataBind();
     }
 }
Beispiel #2
0
        protected void NavigationMenu_MenuItemClick(object sender, MenuEventArgs e)
        {
            MenuItem selectedItem = NavigationMenu.SelectedItem;

            string a = NavigationMenu.SelectedItem.Text;

            using (SqlConnection con = new SqlConnection(constr))
            {
                SqlCommand cmd1 = new SqlCommand("fakultet_tiranes", con);
                cmd1.CommandType = CommandType.StoredProcedure;
                cmd1.Parameters.AddWithValue("@emfakultet", a);
                con.Open();
                SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                DataSet        ds1 = new DataSet();
                da1.Fill(ds1);
                Detail.DataSource = ds1;
                Detail.DataBind();
            }
        }