Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8290467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:49:25+00:00 2026-06-08T12:49:25+00:00

This is NOT asp, just a regular local db program I’m trying to make.

  • 0

This is NOT asp, just a regular local db program I’m trying to make.

i have this edit sub :

Protected Sub update()

    Dim sqlString As String
    Dim pair_0f_attribute As ArrayList = buildSqlUpdate()

    sqlString = "UPDATE " & getSharedTableName() & " SET "
    sqlString = sqlString & String.Join(", ", pair_0f_attribute.ToArray)
    sqlString = sqlString & " WHERE UID = " & id

    cmd = New OleDbCommand(sqlString, conn)
    cmd.CommandType = CommandType.Text

    ExecuteNonQuery(cmd)

End Sub

which gives me error on INSERT command. I’ve break down this huge insert( I got 70+ column, I dont wanna do it manually for all the 2000+ row on my db ) to only get 1 value at a time and check where it fails.

Public Sub editrow(ByVal ID As Integer, ByVal ColumnName As String, ByVal value As Object)

    Dim SqlString As String = "Update " & getSharedTableName() & " Set " & ColumnName & " = ? Where UID = " & ID

    Dim cmd As New OleDbCommand(SqlString, conn)

    cmd.CommandType = CommandType.Text

    cmd.Parameters.AddWithValue(ColumnName, value)

    ExecuteNonQuery(cmd)

End Sub

this work for username, which is a string, level which is an integer, xp which is an integer etc … for a couple of insert, its good, than suddenly on the 8th I get an error on Insert statement.

my ColumnName is “Size”, I tried to change it to “MSize” and I still get an error, and the value is “Medium”.

why would this one fails when columnname “UserName” which use a string wokrs too ?

I’ve check my db to be sure, and the field Size (now MSize) is set at Text, there’s no default value, it can be null, and have 255 max lenght. theres no format or validation or regex used on any field in the DB …

Anyone have any hints on how I should proceed to repair this ?

** Edit

heres to buildSqlUpdate() I used :

 Private Function buildSqlUpdate() As ArrayList
    Dim pair_arraryList As New ArrayList
    For Each element As KeyValuePair(Of String, Object) In attributes
        pair_arraryList.Add("[" & element.Key & "] = '" & element.Value & "'")
    Next
    Return pair_arraryList
End Function

and before you ask 😉 attributes is the DB column names stored in a dictionnary with their value filled in at run time when I build a new instance of an object, it works well, and the string before my insert ( even if way too long ) seems well built when I check it.

***** EDIT *****

I added the bracket as Remou suggested, and now I dont get the same error … if I use the 1st insert ( the fully constructed one ) I get this error :

(syntax error (absent operator) in the following expressions : …. some string value ….

if I use the editrow I dont have any error ( but its long … took about 2 minutes and only went up to 125 item out of 2k )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:49:27+00:00Added an answer on June 8, 2026 at 12:49 pm

    god, the problem was in the pre-made db, theres was errors in column names ( organisatoin instead of organisation ) …

    cant beleive it took me over a week to find that …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fully functioning Dynamic chart control( just the regular ASP.net Chart )
I ask this not to start anything negative. Rather, after looking at ASP.NET MVC
Disclaimer: this is not a question about how to install asp.net or an application
Why ItemStyle-VerticalAlign=Middle not work in asp:GridView?, this is my code <asp:GridView ID=GridView1 runat=server RowStyle-VerticalAlign=Middle
I suspect this applies to general ASP.Net too but I am not sure. If
this is a different question concerning: add a connection to database not working, asp.net
This not a programming question but Most of the programmers using Eclipse should have
One of our ASP.NET WebForms 3.5 pages just suddenly decided not to render the
Okay, this may seem silly, but on an ASP.NET .ascx control, I'm trying to
Possible Duplicate: Does anyone beside me just NOT get ASP.NET MVC? I dont know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.