在adp.fill(ds)中获取实例错误 [英] getting instance error in adp.fill(ds)

查看:438
本文介绍了在adp.fill(ds)中获取实例错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void Button1_Click(object sender, EventArgs e)
        {
              string birthday = (Day.Text + "/" + month.Text + "/" + year.Text);

             string cs = @"Data Source=rachit\\SQLEXPRESS;Initial Catalog=facebook3;Integrated Security=true;";
             SqlConnection conn = new SqlConnection(cs);
             SqlCommand cmd = new SqlCommand("sign_up",conn);
             SqlDataAdapter adp = new SqlDataAdapter(cmd);
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.Add("@fn", SqlDbType.VarChar).Value = fntext;
             cmd.Parameters.Add("@ln", SqlDbType.VarChar).Value = lntext;
             cmd.Parameters.Add("@email", SqlDbType.VarChar).Value = emailtext;
             cmd.Parameters.Add("@pwd", SqlDbType.VarChar).Value = pwdtext;
             cmd.Parameters.Add("@birthdate", SqlDbType.VarChar).Value = birthday;

           
             DataSet ds = new DataSet();
             adp.Fill(ds);
             Response.Redirect(fb2.aspx);

推荐答案

确切的错误是什么,它出现在什么行?



1)在数据库中存储日期作为字符串在某些国家/地区可能会被处死。使用Date数据类型。



2)什么是fb2.aspx?它不是一个有效的标识符,它不是一个字符串,因为它没有用引号括起来。这甚至不会编译,更不用说了。



3)以明文形式存储密码会在所有国家/地区受到死刑惩罚!使用散列算法并存储散列。
What's the exact error and on what line does it occur?

1) Storing dates as strings in your database is punishable by death in some countries. Use the Date datatype.

2) What is "fb2.aspx"? It's not a valid identifier and it's not a string since it's not enclosed in quotes. This could won't even compile let alone run.

3) Storing passwords in clear text is punishable by death in ALL countries! Use a hashing algorithm and store the hash instead.


这篇关于在adp.fill(ds)中获取实例错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆