日期:2014-05-19  浏览次数:20592 次

输入字符串的格式不正确
小弟是位初学者,刚刚编了一个小程序,但是出现在这个问题,查了很久也没发现错误的地方,不知道那位大哥能指点一下,谢谢
程序代码:
protected   void   btn_submit_Click(object   sender,   EventArgs   e)
        {
                if(Page.IsValid)
                {
                        string   strconn   =   "server=localhost;uid=sa;pwd=sa;database=购物 ";
                        SqlConnection   cn   =   new   SqlConnection(strconn);
                        cn.Open();
                        SqlConnection   cn1   =   new   SqlConnection(strconn);
                        cn1.Open();
                        SqlConnection   cn2   =   new   SqlConnection(strconn);
                        cn2.Open();
                        SqlCommand   cm=new   SqlCommand( "ProductAdd ",cn);
                        cm.CommandType=   CommandType.StoredProcedure;
                        cm.Parameters.Add( "@PID ",SqlDbType.Int);
                        cm.Parameters.Add( "@PName ",SqlDbType.VarChar);
                        cm.Parameters.Add( "@PVender ",SqlDbType.VarChar);
                        cm.Parameters.Add( "@PGroup ",SqlDbType.Int);
                        cm.Parameters.Add( "@PDescribe ",SqlDbType.VarChar);
                        SqlCommand   cm1=new   SqlCommand( "PriceAdd ",cn1);
                        cm1.CommandType=CommandType.StoredProcedure;
                        cm1.Parameters.Add( "@PPID ",SqlDbType.Int);
                        cm1.Parameters.Add( "@PPrice ",SqlDbType.Money);
                        cm1.Parameters.Add( "@PDiscount ",SqlDbType.Float);
                        SqlCommand   cm2=new   SqlCommand( "MaxPIDGet ",cn2);
                        cm2.CommandType=CommandType.StoredProcedure;
                        cm2.Parameters.Add( "@maxpid ",   SqlDbType.Int);
                    &n