在c#中怎么判断特征值是否大于0
答案:1 悬赏:70 手机版
解决时间 2021-12-02 18:00
- 提问者网友:太高姿态
- 2021-12-02 08:26
在c#中怎么判断特征值是否大于0
最佳答案
- 五星知识达人网友:几近狂妄
- 2021-12-02 09:45
string strSql = "select panduan from stu";
string strConn = "Data Source=";
SqlConnection dbConn = new SqlConnection(strConn);
dbConn.Open();
//create command object
SqlCommand dbCmd = new SqlCommand(strSql, dbConn);
//use dbComm to create dbReader;
SqlDataReader dbReader = dbCmd.ExecuteReader();
int panduan;
while (dbReader.Read())
{
panduan=dbReader.GetInt32(0)
}
if(panduan==1)
{
button1.enabled=true;
}
else
{
button1.enabled=false;
}
if (null != dbReader)
{
dbReader.Close();
}
if (null != dbCmd)
{
dbCmd.Clone();
}
if (null != dbConn)
{
dbConn.Close();
}
string strConn = "Data Source=";
SqlConnection dbConn = new SqlConnection(strConn);
dbConn.Open();
//create command object
SqlCommand dbCmd = new SqlCommand(strSql, dbConn);
//use dbComm to create dbReader;
SqlDataReader dbReader = dbCmd.ExecuteReader();
int panduan;
while (dbReader.Read())
{
panduan=dbReader.GetInt32(0)
}
if(panduan==1)
{
button1.enabled=true;
}
else
{
button1.enabled=false;
}
if (null != dbReader)
{
dbReader.Close();
}
if (null != dbCmd)
{
dbCmd.Clone();
}
if (null != dbConn)
{
dbConn.Close();
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯