OracleConnection cn = new OracleConnection(@"data source = ctitest;user=oper;password=oper;");
cn.Open(); 
 strSql="select ID,CONNECTID,ANI,DNIS,AGENTID,CUSTOMID,TYPEID,PROGRAMID,TITLE,FLAG,ADDTIME from ccproject_new";
 cmd = new OracleCommand(strSql,cn);
 Da=new OracleDataAdapter(cmd);
 Da.Fill(dset,"ccproject_new");
            
 dset.ReadXml(@"C:\Documents and Settings\Meteor1\My Documents\Visual Studio Projects\声讯数据统计\bin\Debug\free.xml" ); 
               
Da.Update(dset,"ccproject_new");

解决方案 »

  1.   

    都定义了
    OracleCommand cmd = new OracleCommand(strSql,cn);
    OracleDataAdapter Da=new OracleDataAdapter(cmd);
    DataSet dset= new DataSet();
      

  2.   

    错误得地方:1 最明显得错误,没有更新语句,就要Da.Update(dset,"ccproject_new");,是不行得。如果使用SQLText 方式更新就要拼SQL,如果使用Command得话,需要参数得。2 cn.Open();做什么用, Da.Fill(dset,"ccproject_new");方法是会自己打开连接,并且使用后,自动关闭连接。3 dset.ReadXml(@"C:\Documents and Settings\Meteor1\My Documents\Visual Studio Projects\声讯数据统计\bin\Debug\free.xml" ); 会不会把数据放到内存中,并且状态是更新,要查证。不建议这样写,如果从数据库取出得数据与你读入得数据Key重复,指定会出错。……最后建议你问问你附近得同事,就行了,这是比较基础得技术技能。但实现你想实现得功能,还要写些代码得。
      

  3.   

    我要实现的是从XML中提取数据,然后存入这个表中
    你们可以给段例子吗?
      

  4.   

    Public Function UploadSheetCBI(ByRef ds_SheetCBI As DataSet) As Boolean            Dim command As New SqlCommand("sp_UploadSheetCBI", Connection)
                command.CommandType = CommandType.StoredProcedure
                With command.Parameters
                    .Add(New SqlParameter("@sheetobjid", SqlDbType.NChar, 38))
                    .Add(New SqlParameter("@cbiobjid", SqlDbType.NChar, 38))
                    .Add(New SqlParameter("@cbiitemobjid", SqlDbType.NChar, 38))
                    .Add(New SqlParameter("@safevalue", SqlDbType.SmallInt))
                    .Add(New SqlParameter("@riskvalue", SqlDbType.SmallInt))                .Item(0).SourceColumn = "SheetObjID"
                    .Item(1).SourceColumn = "CBIObjID"
                    .Item(2).SourceColumn = "CBIItemObjID"
                    .Item(3).SourceColumn = "SafeValue"
                    .Item(4).SourceColumn = "RiskValue"            End With
                Dim comm As New Common
                command.Transaction = trans
                Dim upload_Adapter As New SqlDataAdapter
                upload_Adapter.TableMappings.Add("Table", "SheetCBI")
                upload_Adapter.InsertCommand = command
                upload_Adapter.Update(ds_SheetCBI, "SheetCBI")
                If ds_SheetCBI.HasErrors Then
                    ds_SheetCBI.Tables("SheetCBI").GetErrors(0).ClearErrors()
                Else
                    ds_SheetCBI.AcceptChanges()
                    UploadSheetCBI = True
                End If
            End Function
    今天上午才写的一段代码,不知对你是否有帮助,你看看吧!
      

  5.   

    加入
    System.Data.OracleClient.OracleCommandBuilder cmb=new OracleCommandBuilder(Da)