Rishi Kumar

Rishi Kumar

  • NA
  • 1
  • 7.9k

unable to insert record into Orace using OdbcData Adapter

Sep 30 2010 4:45 PM
Hi ,
 I am  new to C# and  I am unable to insert the record using below code . can some one help me to find the  reason for that, i can  follow different method to insert the record but want to know the error in my code code.

 DataSet AddDs = new DataSet();

           
            OdbcConnection DbConnection = new OdbcConnection("DSN=ST02;UID=c000155;PWD=#aug2010");
            DbConnection.Open();
           
            OdbcDataAdapter da = new OdbcDataAdapter("SELECT * FROM mig_entry where issue_id=20114", DbConnection);
            da.Fill(AddDs, "mig_entry");
            
           
           
            DataTable dt = AddDs.Tables["mig_entry"];
          
            DataRow RecRow = dt.NewRow();
          
            RecRow["ISSUE_ID"] = 29000;
            RecRow["MODULE_NAME"]="TestModule.ccp";
            RecRow["BUILD_ID"] = 4.1;
            RecRow["CHECK_In_DATE"] = "22-SEP-2010";
            RecRow["CHECK_IN_UID"] = "c000155";
            RecRow["INSTRUCTIONS"] = null;
            RecRow["Module_TYPE"] = "SHLI";
            RecRow["PVCS_PROJECT"] = "1.0";
            RecRow["PVCS_REVISION"] = "1.0";
            RecRow["COMP_STATUS"] = "IP";
            RecRow["ACTIVE_STATUS"] = 'A';
            RecRow["Y2K_DATE"] = null;
            RecRow["APPLC_CD"] = "MFM";

            dt.Rows.Add(RecRow);
            RecRow.AcceptChanges();
          
           DbConnection.Close();



Please help me where I am doing wrong.

Answers (1)