当前位置: 代码迷 >> ASP.NET >> 在線等待解決向SQL2000插入數據問題,该如何解决
  详细解决方案

在線等待解決向SQL2000插入數據問題,该如何解决

热度:238   发布时间:2013-02-25 00:00:00.0
在線等待解決向SQL2000插入數據問題
用的是C#,請大家幫幫忙

using   System;
using   System.Collections;
using   System.ComponentModel;
using   System.Data;
using   System.Drawing;
using   System.Web;
using   System.Web.SessionState;
using   System.Web.UI;
using   System.Web.UI.WebControls;
using   System.Web.UI.HtmlControls;
using   System.Text.RegularExpressions;
using   System.Data.SqlClient;

namespace   Fileupload
{
///   <summary>
///   Addhistory   &ordf;&ordm;&ordm;K&shy;n&acute;y&shy;z&iexcl;C
///   </summary>
public   class   Addhistory   :   System.Web.UI.Page
{
    protected   System.Web.UI.WebControls.Button   Button1;
    protected   System.Web.UI.WebControls.TextBox   TextBox1;
    protected   System.Web.UI.WebControls.TextBox   TextBox2;
    protected   System.Web.UI.WebControls.Label   Label1;

    private   void   Page_Load(object   sender,   System.EventArgs   e)
    {
      Label1.Text=this.Request.QueryString[ "filename "];
    }

    #region   Web   Form   &sup3;]&shy;p¤u¨&atilde;&sup2;&pound;&yen;&Iacute;&ordf;&ordm;&micro;{&brvbar;&iexcl;&frac12;X
    override   protected   void   OnInit(EventArgs   e)
    {
      //
      //   CODEGEN:   &brvbar;&sup1;&not;°   ASP.NET   Web   Form   &sup3;]&shy;p¤u¨&atilde;&copy;&Ograve;&raquo;&Yacute;&ordf;&ordm;&copy;I&yen;s&iexcl;C
      //
      InitializeComponent();
      base.OnInit(e);
    }
   
    ///   <summary>
    ///   &brvbar;&sup1;&not;°&sup3;]&shy;p¤u¨&atilde;¤&auml;&acute;&copy;&copy;&Ograve;&yen;&sup2;&para;·&ordf;&ordm;¤è&ordf;k   -   &frac12;&ETH;¤&Aring;¨&Iuml;&yen;&Icirc;&micro;{&brvbar;&iexcl;&frac12;X&frac12;s&iquest;è&frac34;&sup1;&shy;ק&iuml;
    ///   &sup3;o&shy;&Oacute;¤è&ordf;k&ordf;&ordm;¤&ordm;&reg;e&iexcl;C
    ///   </summary>
    private   void   InitializeComponent()
    {        
      this.Button1.Click   +=   new   System.EventHandler(this.Button1_Click);
      this.Load   +=   new   System.EventHandler(this.Page_Load);

    }
    #endregion
   
    private   void   savehistory()
                {  
                  string   sModel=TextBox1.Text.ToUpper();
                  string   sERP_NO=TextBox2.Text.ToUpper();
                  SqlConnection   conn   =   new   SqlConnection( "data   source=(local);user   id=sa;password=chrdw;database=test ");
                  SqlCommand   cmd   =   new   SqlCommand( "insert   into   VGA(Model,ERP_NO)   VALUES( ' "+sModel+ " ', ' "+sERP_NO+ " ') ",conn);
  相关解决方案