Windows Develop Bookmark and Share   
 index > Windows Forms General > DataAdapter Update Problem[Argent]
 

DataAdapter Update Problem[Argent]

Hi Friends,

Today I tried to update Access database with the help of OleDB DataAdapter.Update(DataRow). I create a datarow and pass that argument to that Update Method. But it raised exception like syntax error....... Latter I create a typed dataset with a large table and try to update that table. But [To many fields are added] message come. My Table is too large. approximately 150 columns. How can I update that table with datarow. Anybody please.

Habib

BD

Habibsql  Thursday, March 08, 2007 2:24 PM

Well i have the same problem, a legacy application is using 250 column in Ms-access without any problem, after migrating in .net we are stuck.

I have constructed the dataAdapter directly with code like that

Me.OleDbDataAdapterAPPA.UpdateCommand = Me.OleDbConnection1.CreateCommand()

Me.OleDbDataAdapterAPPA.InsertCommand = Me.OleDbConnection1.CreateCommand

With Me.OleDbDataAdapterAPPA.UpdateCommand

.CommandText += " update APPAREIL set "

'--- Pour chaque chaque paramètre ...

Dim i As Integer = 0

For Each dc As DataColumn In Me.DataSet21.Tables("EQ").Columns

Dim xc, xCarry As String

' xc = "PID"

If dc.DataType.Name = "String" Then

xc = dc.ColumnName

.CommandText += xCarry & "[" & xc & "]=? "

xCarry = ", "

.Parameters.Add(xc, OleDbType.Char, 0, xc)

End If

Next

.CommandText += " where CLEF_APPAREIL=? "

.Parameters.Add("CLEF_APPAREIL", OleDbType.Integer, 0, "CLEF_APPAREIL")

End With

but it seems that the Jet OleDb is limited to 128 columns whatever you try.

Before spliting the table in many narow tables in a one to one relationship i am looking for a way to fix that problem

regards

Loïc

lmoreau  Thursday, April 26, 2007 12:19 PM

You can use google to search for other answers

Custom Search

More Threads

• Detecting presence of vertical scrollbar in a ListView
• Automatic shift of ScrollableControl contents
• Is creating form objects and disposing them better or using Activator.CreateInstance()?
• Transparent Image Button
• Subclassed control in Toolbox
• Listing all settings
• Property Grid Troubles
• SEHException
• Visual Studio 2005 help required
• Getting program version