NKarthick
April 15th, 2008, 04:37 AM
HI
i am selectin some values from the listbox and trasferring those to another listbox from which i need to store it into the database (sql2000)
the database connection is working correctly (i.e., i was able to retrieve the information from the database)
but i was not able ot insert an item into the database
i had established the connection and written the command in the following way
conn = New OleDbConnection("provider=SQLOLEDB;server=user-r;database=map;User Id=sa;Password=sa")
conn.Open()
command = New OleDbCommand("insert into dhf(muser,map1,map2,map3,map4,map5)values(muser,map1.map2,map3,map4,map5)", conn)
command.ExecuteNonQuery()
nut while executing hte query i am gettiing the following error
cannot save the name 'muser'is not permitted in this contextr , only constants, expressions or variab\bles allowed here.
column names are not premitted
please do me the need
i am selectin some values from the listbox and trasferring those to another listbox from which i need to store it into the database (sql2000)
the database connection is working correctly (i.e., i was able to retrieve the information from the database)
but i was not able ot insert an item into the database
i had established the connection and written the command in the following way
conn = New OleDbConnection("provider=SQLOLEDB;server=user-r;database=map;User Id=sa;Password=sa")
conn.Open()
command = New OleDbCommand("insert into dhf(muser,map1,map2,map3,map4,map5)values(muser,map1.map2,map3,map4,map5)", conn)
command.ExecuteNonQuery()
nut while executing hte query i am gettiing the following error
cannot save the name 'muser'is not permitted in this contextr , only constants, expressions or variab\bles allowed here.
column names are not premitted
please do me the need