本文整理汇总了C#中Class2.GetAll方法的典型用法代码示例。如果您正苦于以下问题:C# Class2.GetAll方法的具体用法?C# Class2.GetAll怎么用?C# Class2.GetAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Class2
的用法示例。
在下文中一共展示了Class2.GetAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Class2 ad = new Class2();
DataSet abc = ad.GetAll();
GridView1.DataSource = abc;
GridView1.DataBind();
}
示例2: Button2_Click
protected void Button2_Click(object sender, EventArgs e)
{
Class2 ad = new Class2();
DataSet abc = ad.GetAll();
GridView1.DataSource = abc;
GridView1.DataBind();
}
示例3: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
string qq = "Data Source=gz-20150728tajv\\sqlexpress;Initial Catalog=Student1;Integrated Security=True ";
SqlConnection Conn = new SqlConnection(qq);
Conn.Open();
string SQL = "UPDATE student_management SET " + TextBox2.Text + "='" + TextBox3.Text + "' where 学号='" + TextBox1.Text + "'";
SqlCommand cmd = new SqlCommand(SQL, Conn);
cmd.ExecuteNonQuery();
Conn.Close();
Class2 ad = new Class2();
DataSet abc = ad.GetAll();
GridView1.DataSource = abc;
GridView1.DataBind();
}
示例4: Button3_Click
protected void Button3_Click(object sender, EventArgs e)
{
string qq = "Data Source=gz-20150728tajv\\sqlexpress;Initial Catalog=Student1;Integrated Security=True ";
SqlConnection Conn = new SqlConnection(qq);
Conn.Open();
string SQL1 = "UPDATE student_management SET 寝室号='" + TextBox4.Text + "',是否入住='是' where 学号='" + TextBox3.Text + "'";
string SQL2 = "UPDATE dormitory_management SET 是否住满='是' where 寝室号='"+TextBox4.Text+"'";
string SQL3 = "UPDATE dormitory_management SET 是否住满='否' where 寝室号='" + TextBox4.Text + "'";
string str = "select count(*) from student_management where 寝室号='" + TextBox4.Text + "'";
SqlCommand cmd1 = new SqlCommand(SQL1, Conn);
cmd1.ExecuteNonQuery();
SqlCommand count = new SqlCommand(str, Conn);
string num1 = (count.ExecuteScalar()).ToString();
int number = Convert.ToInt16(num1);
if (number == 4)
{
SqlCommand cmd2 = new SqlCommand(SQL2, Conn);
cmd2.ExecuteNonQuery();
}
else
{
SqlCommand cmd2 = new SqlCommand(SQL3, Conn);
cmd2.ExecuteNonQuery();
}
Conn.Close();
Class2 ad1 = new Class2();
DataSet abc1 = ad1.GetAll();
GridView1.DataSource = abc1;
GridView1.DataBind();
Class1 ad2 = new Class1();
DataSet abc2 = ad2.GetAll();
GridView2.DataSource = abc2;
GridView2.DataBind();
TextBox3.Text = "";
TextBox4.Text = "";
}