本文整理汇总了C#中DAO.Excute方法的典型用法代码示例。如果您正苦于以下问题:C# DAO.Excute方法的具体用法?C# DAO.Excute怎么用?C# DAO.Excute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAO
的用法示例。
在下文中一共展示了DAO.Excute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DAO
private void 注册_Click(object sender, EventArgs e)
{
ulong stuno = Convert.ToUInt64(reg_stuNo.Text);
ushort cardno = Convert.ToUInt16(reg_cardNo.Text);
DAO dao = new DAO();
MySql.Data.MySqlClient.MySqlDataReader rdr =
(MySql.Data.MySqlClient.MySqlDataReader)dao.Excute("select stuName from students where stuNo = " + stuno);
if (rdr.Read() == false)
{
MessageBox.Show("没有该学号");
return;
}
if (Card.IssueCard(stuno, cardno, rdr["stuName"] as string, (byte)(underGraduate.Focused ? 1 : 2)) == false)
{
MessageBox.Show("发卡失败");
return;
}
ushort predepoist = Convert.ToUInt16(reg_preDeposit.Text);
if (predepoist > 0)
{
Card.Charge(cardno, (ushort)(predepoist * 10));
}
}
示例2: Net
private void 挂失_Click(object sender, EventArgs e)
{
Net send = new Net(restaurantServer, restaurantPort);
DAO dao = new DAO();
MySql.Data.MySqlClient.MySqlDataReader rdr =
(MySql.Data.MySqlClient.MySqlDataReader)dao.Excute(
"select cardNo from cards where StuNo='" + sub_stuNo.Text + "'"
);
if (rdr.Read()==false)
{
MessageBox.Show("不存在该学号");
return;
}
if (send.Send(rdr["cardNo"] as string) == false)
{
MessageBox.Show("发送挂失信息失败");
return;
}
MessageBox.Show("挂失成功");
}