protected void imgpath_check(Object sender, EventArgs e)
{
rc_id=Session["rc_id"].ToString();
tablename="rc_info"; //数据库里的表 try
{ string strconn = ConfigurationSettings.AppSettings["SqlConnectionString"];
SqlConnection myconn=new SqlConnection(strconn);
'vb的 myconn.Open();
dim cmd as SqlDataAdapter =new SqlDataAdapter ("select flag from rc_info where name='"+ name +"'",myconn)
dim dst as dataset=new dataset()
cmd.fill(dst)
if( dst.tables(0).rows(0)("列值").tostring )
{
}
else
{
}
myconn.Close();
} catch(Exception)
{
} }
{
rc_id=Session["rc_id"].ToString();
tablename="rc_info"; //数据库里的表 try
{ string strconn = ConfigurationSettings.AppSettings["SqlConnectionString"];
SqlConnection myconn=new SqlConnection(strconn);
'vb的 myconn.Open();
dim cmd as SqlDataAdapter =new SqlDataAdapter ("select flag from rc_info where name='"+ name +"'",myconn)
dim dst as dataset=new dataset()
cmd.fill(dst)
if( dst.tables(0).rows(0)("列值").tostring )
{
}
else
{
}
myconn.Close();
} catch(Exception)
{
} }
{
rc_id=Session["rc_id"].ToString();
tablename="rc_info"; //数据库里的表 try
{ string strconn = ConfigurationSettings.AppSettings["SqlConnectionString"];
SqlConnection myconn=new SqlConnection(strconn);
selcetCmd = "";
SqlCommand myCommand = SqlCommand(selectCmd,myconn);
myconn.Open();
SqlDataReader myReader = myCommand.ExcuteReader(CommandBehavior.CloseConnection);
while(myReader.Read())
{
if(myReader.IsDBNull()
{}
else
{})
}
}
SqlConnection myconn=new SqlConnection(strconn);
SqlCommand cmd=new SqlCommand("select 产品图片目录 from "+tablename+" where 用户ID="+rc_id,myconn);
myconn.Open();
object obj=myconn.ExecuteScalar();
if(obj==DBNull.Value){
//字段值是null
}
else{
//不是null
}
myconn.Close();--------------------------------
AspNetPager 免费分页控件4.2版发布,同时发布最新源代码,欢迎下载:http://www.webdiyer.com
..
else
end if
{
rc_id=Session["rc_id"].ToString();
tablename="rc_info"; try
{
string strconn = ConfigurationSettings.AppSettings["SqlConnectionString"];
SqlConnection myconn=new SqlConnection(strconn);
SqlCommand cmd=new SqlCommand("select 产品图片目录 from "+tablename+" where 编号="+rc_id,myconn);
myconn.Open();
object obj=cmd.ExecuteScalar();
if(obj==DBNull.Value)
{
this.Label1.Text="空!"; //字段值是null
}
else
{
this.Label1.Text="不空!"; //不是null
}
myconn.Close();
} catch(Exception)
{
} }
但是还有一点就是 lable1 不显示信息,我在调试一下吧,如果不行,再请教。先给分,我先下了,明天再来!谢谢