返回首页

您好,
我在做一个基于Web的GUI.Whose前端是ASP.NET.The屏幕上有许多控制,如下拉选择框etc.When在下拉perticular的参数是当前的设置应保存,在数据base.So我需要为保存button.Please指南我#代码..新的C#

问候

回答

评论会员:游客 时间:2012/02/04
Raji细胞在CodeProject
 SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Your Database Name;Integrated Security=True");

            con.Open();

            SqlCommand command= new  SqlCommand();        

            command.Connection = con;

            command.CommandType = CommandType.Text;

            command.CommandText = "your query here"

 

            

            try

            {

                command.ExecuteNonQuery();

                con.Close();

              

 

            }

 

            catch (Exception e)

            {

               

            }

           

 



评论会员:游客 时间:2012/02/04
SAKryukov:imgsrc=]。这种问题是无用的。另见:{A1}]mdash;SA