标题:[求助]着程序怎么就过不去
取消只看楼主
xjtt
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-11-5
 问题点数:0 回复次数:2 
[求助]着程序怎么就过不去

这是按的代码
可可就是调试不成~~~~~~~~~~
红色的是报错的地方
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Dada.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{

}
protected void Button1_Click1(object sender, EventArgs e)
{
sqlConnection mycon = new SqlConnection("server=(192.168.0.7);DataBase=hsdweb2007;ID=sa;PWD=sa");
mycon.Open();
sqlCommand mycom = new Sqlcommand("select count(*)forn tb_UserData where useername='"+TextBox1.Text+""',mycon);
int count = Convert.ToInt32(mycom.ExecuteScalar());
if(count>0)
{
Response.Write("<script>alert('用户名已存在!');location='javascript:history.go(-1)'</script>");
  }
  }
if(TextBox2.Text != TextBox3.Text)
{
Response.Write("<script>alert('两次输入密码不一至,从新输入!');location='javascript:history.go(-1)'</script>");
}
else
{
SqlConnection con=new SqlConnection("server=(192.168.0.7);DataBase=hsdweb2007;ID=sa;PWD=sa");
con.Open();
sqlTransaction static=con.BeginTransaction();
sqlCommand com=con.CreateCommand();
com.Transaction=sa;
tey
{
com.CommandText="insert into tb_UserData(username,sex,userped,matter,resule,mail,headportrairId,oicq.name,del)
values('"TextBox1.Text+"','"DropDownlist2.Text+"','"+TextBox3.Text+"','"+TextBox5.Text+"','"+TextBox6.Text+"','"+TextBox7.Text+"','"+DropDownlist1.Text+"','"+DropDownlist8.Text+"','"+DropDownlist9.Text+"','"DropDownlist10.Text+"')";

com.ExecuteNonQuery();
com.CommandTexe="insert into tb_log(ip,datetime,name,dns)values('"+Response.userhostaddress+"','"+DataTime.Now+"','"+TextBox1.Text+"','"+"+Response.userhostName+"')";
com.ExecuteNonQuery();
st.Commit();
Response.Write("<script>alert('注册成功!');location='javascript:history.go(-1)'</script>");
}
catch(exception error)
{
st.Rollback();
}

}
}

搜索更多相关主题的帖子: public 
2007-11-05 17:51
xjtt
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-11-5
得分:0 

恩!这是手写的
try也该了又出现

2007-11-06 12:27
xjtt
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2007-11-5
得分:0 
cs0234:命名空间"System"中不存在类型或命名空间名称"Data"
2007-11-06 12:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-183694-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.777703 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved