如何将页面的东西添加到数据库
string regname=this.regname.Value;
string regpwd=this.regpwd.Value;
string regpwdrepeat=this.regpwdrepeat.Value;
string regemail=this.regemail.Value;
string regsex=this.regsex.Value;
string regintroduce=this.regintroduce.Value;
SqlCommand com=new SqlCommand(sql,con);
com.CommandText="insert into forumuser value(@regname='"+regname+"',@regpwd='"+regpwd+"',@regemail='"+regemail+"',@regsex='"+regsex+"',@regintroduce='"+regintroduce+"')";
com.Parameters.Add("@regname","UName");
com.Parameters.Add("@regpwd","UPassword");
com.Parameters.Add("@regemail","UEmail");
com.Parameters.Add("@regsex","USex");
com.Parameters.Add("@regintroduce","UStatement");
com.CommandType=CommandType.Text;
com.ExecuteNonQuery();