I'm working on a project in VB.net connecting to a SQL Server 2000 database
that I can't modify
I created a dataset with a schema identical to the DB.
When trying to update the DB from the dataset using the dataAdapter.upd ate
sub, I get an error.
The problem seems to be that one of the fields was named 'desc' which is a
reserved word for SQL.
I've been able to work around this design flaw 'till now but it looks like
the update sub can't handle it.
I used the command builder to create the Update, Insert and Delete scripts.
The trace is like this:
An unhandled exception of type 'System.Data.Sq lClient.SqlExce ption' occurred
in system.data.dll
Additional information: System error.
Unhandled Exception: System.Data.Sql Client.SqlExcep tion: Incorrect syntax
near the keyword 'desc'.
at System.Data.Com mon.DbDataAdapt er.Update(DataR ow[] dataRows,
DataTableMappin g tableMapping)
at System.Data.Com mon.DbDataAdapt er.Update(DataT able dataTable)
Is there a way around this? 17 3813
> I'm working on a project in VB.net connecting to a SQL Server 2000
database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset using the dataAdapter.upd ate sub, I get an error.
If you cannot modify the database, why bother trying to update it? This
would be my first red flag.
I've been able to work around this design flaw 'till now but it looks like the update sub can't handle it.
Every once in a while, someone makes a column or other object in a database
whose name is a reserved word. SQL Server will let you refer to this if you
enclose the object's identifier in square brackets:
SELECT [Desc] FROM t_SomeTable
Sometimes, SQL Server will understand what you mean if you qualify the item
you are referring to:
SELECT t_SomeTable.Des c FROM t_SomeTable
Another thing you might consider, though I personally don't like it is this:
SET QUOTED_IDENTIFI ER ON
SELECT "Desc" FROM t_SomeTable
SET QUOTED_IDENTIFI ER OFF
Generally speaking, the SQL Server Query Analyzer is your best friend for
figuring out correct SQL syntax irrespective of application code. Once you
get the SQL syntax to do the right thing in Query Analyzer, then try it in
your application code. If it then doesn't work, there is something else
going wrong, such as runtime permissions or other screwy application stuff.
--
Peace & happy computing,
Mike Labosh, MCSD MCT
Owner, vbSensei.Com
"Escriba coda ergo sum." -- vbSensei
when I said that I can't modify the DB, I meant the structure, not the data.
I was aware of the [] work around but it doesn't look like VB.net does it.
The update code is generated by VB.net as I used the command builder (don't
waste your time telling me that I should write my own instead of using the
command builder)
It looks like if you use a reserved word, VB.net will not take any
precautions to avoid an error when dealing with the database.
Is there a way to correct that problem?
"Mike Labosh" <ml************ *****@vbsensei. com> wrote in message
news:ur******** ******@TK2MSFTN GP11.phx.gbl... I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset using the
dataAdapter.upd ate sub, I get an error.
If you cannot modify the database, why bother trying to update it? This would be my first red flag.
I've been able to work around this design flaw 'till now but it looks
like the update sub can't handle it.
Every once in a while, someone makes a column or other object in a
database whose name is a reserved word. SQL Server will let you refer to this if
you enclose the object's identifier in square brackets:
SELECT [Desc] FROM t_SomeTable
Sometimes, SQL Server will understand what you mean if you qualify the
item you are referring to:
SELECT t_SomeTable.Des c FROM t_SomeTable
Another thing you might consider, though I personally don't like it is
this: SET QUOTED_IDENTIFI ER ON SELECT "Desc" FROM t_SomeTable SET QUOTED_IDENTIFI ER OFF
Generally speaking, the SQL Server Query Analyzer is your best friend for figuring out correct SQL syntax irrespective of application code. Once
you get the SQL syntax to do the right thing in Query Analyzer, then try it in your application code. If it then doesn't work, there is something else going wrong, such as runtime permissions or other screwy application
stuff. -- Peace & happy computing,
Mike Labosh, MCSD MCT Owner, vbSensei.Com "Escriba coda ergo sum." -- vbSensei
Benoit:
If there's a battle worth fighting, it's Changing column names that are
reserved words. Have you tried changing the Alias on it w/ the []? I've
been told by many that it should work unless you are using access. If you
can't do any of that, why not create a View based on the table and give it
real names. Whoever insists on using Desc and not letting you change it is
being Very shortsighted, but he/she couldn't possibly prohibit you from
creating a view and using it instead.
"Benoit Martin" <bm*********@ho tmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. when I said that I can't modify the DB, I meant the structure, not the
data. I was aware of the [] work around but it doesn't look like VB.net does it. The update code is generated by VB.net as I used the command builder
(don't waste your time telling me that I should write my own instead of using the command builder) It looks like if you use a reserved word, VB.net will not take any precautions to avoid an error when dealing with the database.
Is there a way to correct that problem?
"Mike Labosh" <ml************ *****@vbsensei. com> wrote in message news:ur******** ******@TK2MSFTN GP11.phx.gbl... I'm working on a project in VB.net connecting to a SQL Server 2000 database that I can't modify I created a dataset with a schema identical to the DB. When trying to update the DB from the dataset using the dataAdapter.upd ate sub, I get an error.
If you cannot modify the database, why bother trying to update it? This would be my first red flag.
I've been able to work around this design flaw 'till now but it looks like the update sub can't handle it.
Every once in a while, someone makes a column or other object in a
database whose name is a reserved word. SQL Server will let you refer to this if you enclose the object's identifier in square brackets:
SELECT [Desc] FROM t_SomeTable
Sometimes, SQL Server will understand what you mean if you qualify the item you are referring to:
SELECT t_SomeTable.Des c FROM t_SomeTable
Another thing you might consider, though I personally don't like it is this: SET QUOTED_IDENTIFI ER ON SELECT "Desc" FROM t_SomeTable SET QUOTED_IDENTIFI ER OFF
Generally speaking, the SQL Server Query Analyzer is your best friend
for figuring out correct SQL syntax irrespective of application code. Once
you get the SQL syntax to do the right thing in Query Analyzer, then try it
in your application code. If it then doesn't work, there is something else going wrong, such as runtime permissions or other screwy application stuff. -- Peace & happy computing,
Mike Labosh, MCSD MCT Owner, vbSensei.Com "Escriba coda ergo sum." -- vbSensei
thanks William,
not being able to change the field name is not too much a problem of being
stuborn but more a problem with the consequences of changing this field
name.
When you are talking about Alia, is it in the dataset? I wasn't aware of
this alias "property". Where is that set?
Thank you
"William Ryan" <do********@nos pam.comcast.net > wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. . Benoit:
If there's a battle worth fighting, it's Changing column names that are reserved words. Have you tried changing the Alias on it w/ the []? I've been told by many that it should work unless you are using access. If you can't do any of that, why not create a View based on the table and give it real names. Whoever insists on using Desc and not letting you change it
is being Very shortsighted, but he/she couldn't possibly prohibit you from creating a view and using it instead. "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. when I said that I can't modify the DB, I meant the structure, not the data. I was aware of the [] work around but it doesn't look like VB.net does
it. The update code is generated by VB.net as I used the command builder (don't waste your time telling me that I should write my own instead of using
the command builder) It looks like if you use a reserved word, VB.net will not take any precautions to avoid an error when dealing with the database.
Is there a way to correct that problem?
"Mike Labosh" <ml************ *****@vbsensei. com> wrote in message news:ur******** ******@TK2MSFTN GP11.phx.gbl... > I'm working on a project in VB.net connecting to a SQL Server 2000 database > that I can't modify > I created a dataset with a schema identical to the DB. > When trying to update the DB from the dataset using the dataAdapter.upd ate > sub, I get an error.
If you cannot modify the database, why bother trying to update it?
This would be my first red flag.
> I've been able to work around this design flaw 'till now but it
looks like > the update sub can't handle it.
Every once in a while, someone makes a column or other object in a database whose name is a reserved word. SQL Server will let you refer to this
if you enclose the object's identifier in square brackets:
SELECT [Desc] FROM t_SomeTable
Sometimes, SQL Server will understand what you mean if you qualify the item you are referring to:
SELECT t_SomeTable.Des c FROM t_SomeTable
Another thing you might consider, though I personally don't like it is this: SET QUOTED_IDENTIFI ER ON SELECT "Desc" FROM t_SomeTable SET QUOTED_IDENTIFI ER OFF
Generally speaking, the SQL Server Query Analyzer is your best friend for figuring out correct SQL syntax irrespective of application code.
Once you get the SQL syntax to do the right thing in Query Analyzer, then try
it in your application code. If it then doesn't work, there is something
else going wrong, such as runtime permissions or other screwy application
stuff. -- Peace & happy computing,
Mike Labosh, MCSD MCT Owner, vbSensei.Com "Escriba coda ergo sum." -- vbSensei
SELECT SomeColumn as AliasName from MyTable
"Benoit Martin" <bm*********@ho tmail.com> wrote in message
news:Ob******** ******@tk2msftn gp13.phx.gbl... thanks William,
not being able to change the field name is not too much a problem of being stuborn but more a problem with the consequences of changing this field name.
When you are talking about Alia, is it in the dataset? I wasn't aware of this alias "property". Where is that set?
Thank you
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** *******@tk2msft ngp13.phx.gbl.. . Benoit:
If there's a battle worth fighting, it's Changing column names that are reserved words. Have you tried changing the Alias on it w/ the []?
I've been told by many that it should work unless you are using access. If
you can't do any of that, why not create a View based on the table and give
it real names. Whoever insists on using Desc and not letting you change it is being Very shortsighted, but he/she couldn't possibly prohibit you from creating a view and using it instead. "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. when I said that I can't modify the DB, I meant the structure, not the data. I was aware of the [] work around but it doesn't look like VB.net does it. The update code is generated by VB.net as I used the command builder
(don't waste your time telling me that I should write my own instead of using the command builder) It looks like if you use a reserved word, VB.net will not take any precautions to avoid an error when dealing with the database.
Is there a way to correct that problem?
"Mike Labosh" <ml************ *****@vbsensei. com> wrote in message news:ur******** ******@TK2MSFTN GP11.phx.gbl... > > I'm working on a project in VB.net connecting to a SQL Server 2000 > database > > that I can't modify > > I created a dataset with a schema identical to the DB. > > When trying to update the DB from the dataset using the dataAdapter.upd ate > > sub, I get an error. > > If you cannot modify the database, why bother trying to update it? This > would be my first red flag. > > > I've been able to work around this design flaw 'till now but it looks like > > the update sub can't handle it. > > Every once in a while, someone makes a column or other object in a database > whose name is a reserved word. SQL Server will let you refer to
this if you > enclose the object's identifier in square brackets: > > SELECT [Desc] FROM t_SomeTable > > Sometimes, SQL Server will understand what you mean if you qualify
the item > you are referring to: > > SELECT t_SomeTable.Des c FROM t_SomeTable > > Another thing you might consider, though I personally don't like it
is this: > > SET QUOTED_IDENTIFI ER ON > SELECT "Desc" FROM t_SomeTable > SET QUOTED_IDENTIFI ER OFF > > Generally speaking, the SQL Server Query Analyzer is your best
friend for > figuring out correct SQL syntax irrespective of application code. Once you > get the SQL syntax to do the right thing in Query Analyzer, then try it in > your application code. If it then doesn't work, there is something else > going wrong, such as runtime permissions or other screwy application stuff. > -- > Peace & happy computing, > > Mike Labosh, MCSD MCT > Owner, vbSensei.Com > "Escriba coda ergo sum." -- vbSensei > >
oh, that's what you were talking about, sorry...
unfortunately I don't think it's gonna work for me as the code is generated
by VB and I don't write any SELECT statement for my update command.
I guess there is no work around then
"William Ryan" <do********@nos pam.comcast.net > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. SELECT SomeColumn as AliasName from MyTable "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:Ob******** ******@tk2msftn gp13.phx.gbl... thanks William,
not being able to change the field name is not too much a problem of
being stuborn but more a problem with the consequences of changing this field name.
When you are talking about Alia, is it in the dataset? I wasn't aware of this alias "property". Where is that set?
Thank you
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** *******@tk2msft ngp13.phx.gbl.. . Benoit:
If there's a battle worth fighting, it's Changing column names that
are reserved words. Have you tried changing the Alias on it w/ the []? I've been told by many that it should work unless you are using access. If you can't do any of that, why not create a View based on the table and
give it real names. Whoever insists on using Desc and not letting you change
it is being Very shortsighted, but he/she couldn't possibly prohibit you
from creating a view and using it instead. "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. > when I said that I can't modify the DB, I meant the structure, not
the data. > > I was aware of the [] work around but it doesn't look like VB.net
does it. > The update code is generated by VB.net as I used the command builder (don't > waste your time telling me that I should write my own instead of
using the > command builder) > It looks like if you use a reserved word, VB.net will not take any > precautions to avoid an error when dealing with the database. > > Is there a way to correct that problem? > > "Mike Labosh" <ml************ *****@vbsensei. com> wrote in message > news:ur******** ******@TK2MSFTN GP11.phx.gbl... > > > I'm working on a project in VB.net connecting to a SQL Server
2000 > > database > > > that I can't modify > > > I created a dataset with a schema identical to the DB. > > > When trying to update the DB from the dataset using the > dataAdapter.upd ate > > > sub, I get an error. > > > > If you cannot modify the database, why bother trying to update it? This > > would be my first red flag. > > > > > I've been able to work around this design flaw 'till now but it looks > like > > > the update sub can't handle it. > > > > Every once in a while, someone makes a column or other object in a > database > > whose name is a reserved word. SQL Server will let you refer to
this if > you > > enclose the object's identifier in square brackets: > > > > SELECT [Desc] FROM t_SomeTable > > > > Sometimes, SQL Server will understand what you mean if you qualify the > item > > you are referring to: > > > > SELECT t_SomeTable.Des c FROM t_SomeTable > > > > Another thing you might consider, though I personally don't like
it is > this: > > > > SET QUOTED_IDENTIFI ER ON > > SELECT "Desc" FROM t_SomeTable > > SET QUOTED_IDENTIFI ER OFF > > > > Generally speaking, the SQL Server Query Analyzer is your best friend for > > figuring out correct SQL syntax irrespective of application code. Once > you > > get the SQL syntax to do the right thing in Query Analyzer, then
try it in > > your application code. If it then doesn't work, there is
something else > > going wrong, such as runtime permissions or other screwy
application > stuff. > > -- > > Peace & happy computing, > > > > Mike Labosh, MCSD MCT > > Owner, vbSensei.Com > > "Escriba coda ergo sum." -- vbSensei > > > > > >
Hi Benoit,
Take a look on your form and see if you see there below the OleDBdatadapter
or the SQLdataadapter.
Probably it is there rightclick on it and choose configure adapter, there
you can change your select statement.
I hope this helps
Cor unfortunately I don't think it's gonna work for me as the code is
generated by VB and I don't write any SELECT statement for my update command.
Sorry, but I have to step in here. I've been watching this thread with
dubious interest.
You seem to have this idea that command builder is king, well let me tell
you that it is not.
Command builder can only handle simple queries, sooner or later you are
going
to have to roll up your sleeves and get your hands dirty.
Bill' suggestion is a good one, simply modify the code already produced by
the
command builer to suit your needs.
OHM#
Benoit Martin wrote: oh, that's what you were talking about, sorry...
unfortunately I don't think it's gonna work for me as the code is generated by VB and I don't write any SELECT statement for my update command.
I guess there is no work around then
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. SELECT SomeColumn as AliasName from MyTable "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:Ob******** ******@tk2msftn gp13.phx.gbl... thanks William,
not being able to change the field name is not too much a problem of being stuborn but more a problem with the consequences of changing this field name.
When you are talking about Alia, is it in the dataset? I wasn't aware of this alias "property". Where is that set?
Thank you
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** *******@tk2msft ngp13.phx.gbl.. . Benoit:
If there's a battle worth fighting, it's Changing column names that are reserved words. Have you tried changing the Alias on it w/ the []? I've been told by many that it should work unless you are using access. If you can't do any of that, why not create a View based on the table and give it real names. Whoever insists on using Desc and not letting you change it is being Very shortsighted, but he/she couldn't possibly prohibit you from creating a view and using it instead. "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. > when I said that I can't modify the DB, I meant the structure, > not the data. > > I was aware of the [] work around but it doesn't look like VB.net > does it. The update code is generated by VB.net as I used the > command builder (don't waste your time telling me that I should > write my own instead of using the command builder) > It looks like if you use a reserved word, VB.net will not take any > precautions to avoid an error when dealing with the database. > > Is there a way to correct that problem? > > "Mike Labosh" <ml************ *****@vbsensei. com> wrote in message > news:ur******** ******@TK2MSFTN GP11.phx.gbl... >>> I'm working on a project in VB.net connecting to a SQL Server >>> 2000 database that I can't modify >>> I created a dataset with a schema identical to the DB. >>> When trying to update the DB from the dataset using the >>> dataAdapter.upd ate sub, I get an error. >> >> If you cannot modify the database, why bother trying to update >> it? This would be my first red flag. >> >>> I've been able to work around this design flaw 'till now but it >>> looks like the update sub can't handle it. >> >> Every once in a while, someone makes a column or other object in >> a database whose name is a reserved word. SQL Server will let >> you refer to this if > you >> enclose the object's identifier in square brackets: >> >> SELECT [Desc] FROM t_SomeTable >> >> Sometimes, SQL Server will understand what you mean if you >> qualify the item you are referring to: >> >> SELECT t_SomeTable.Des c FROM t_SomeTable >> >> Another thing you might consider, though I personally don't like it is> this: >> >> SET QUOTED_IDENTIFI ER ON >> SELECT "Desc" FROM t_SomeTable >> SET QUOTED_IDENTIFI ER OFF >> >> Generally speaking, the SQL Server Query Analyzer is your best >> friend for figuring out correct SQL syntax irrespective of >> application code. Once you get the SQL syntax to do the right >> thing in Query Analyzer, then try it in >> your application code. If it then doesn't work, there is >> something else going wrong, such as runtime permissions or other >> screwy application stuff. -- >> Peace & happy computing, >> >> Mike Labosh, MCSD MCT >> Owner, vbSensei.Com >> "Escriba coda ergo sum." -- vbSensei
Regards - OHM# On**********@BT Internet.com
Hi OHM are you sure the OP is using the commandbuilder, this looks like drag
and drop, but I can be wrong.
He says "I dont write any SELECT statement"
Not "I dont write any UPDATE statement"
But maybe I am wrong, and maybe he answer us about that after this message.
Cor
"One Handed Man [ OHM# ]" <te************ *************** @BTOpenworld.co m>
schreef in bericht news:eq******** ******@TK2MSFTN GP09.phx.gbl... Sorry, but I have to step in here. I've been watching this thread with dubious interest.
You seem to have this idea that command builder is king, well let me tell you that it is not. Command builder can only handle simple queries, sooner or later you are going to have to roll up your sleeves and get your hands dirty.
Bill' suggestion is a good one, simply modify the code already produced by the command builer to suit your needs.
OHM# Benoit Martin wrote: oh, that's what you were talking about, sorry...
unfortunately I don't think it's gonna work for me as the code is generated by VB and I don't write any SELECT statement for my update command.
I guess there is no work around then
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. SELECT SomeColumn as AliasName from MyTable "Benoit Martin" <bm*********@ho tmail.com> wrote in message news:Ob******** ******@tk2msftn gp13.phx.gbl... thanks William,
not being able to change the field name is not too much a problem of being stuborn but more a problem with the consequences of changing this field name.
When you are talking about Alia, is it in the dataset? I wasn't aware of this alias "property". Where is that set?
Thank you
"William Ryan" <do********@nos pam.comcast.net > wrote in message news:%2******** *******@tk2msft ngp13.phx.gbl.. . > Benoit: > > If there's a battle worth fighting, it's Changing column names > that are reserved words. Have you tried changing the Alias on it > w/ the []? I've been told by many that it should work unless you > are using access. If you can't do any of that, why not create a > View based on the table and give it real names. Whoever insists > on using Desc and not letting you change it is being Very > shortsighted, but he/she couldn't possibly prohibit you from > creating a view and using it instead. "Benoit Martin" > <bm*********@ho tmail.com> wrote in message > news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. >> when I said that I can't modify the DB, I meant the structure, >> not the data. >> >> I was aware of the [] work around but it doesn't look like VB.net >> does it. The update code is generated by VB.net as I used the >> command builder (don't waste your time telling me that I should >> write my own instead of using the command builder) >> It looks like if you use a reserved word, VB.net will not take any >> precautions to avoid an error when dealing with the database. >> >> Is there a way to correct that problem? >> >> "Mike Labosh" <ml************ *****@vbsensei. com> wrote in message >> news:ur******** ******@TK2MSFTN GP11.phx.gbl... >>>> I'm working on a project in VB.net connecting to a SQL Server >>>> 2000 database that I can't modify >>>> I created a dataset with a schema identical to the DB. >>>> When trying to update the DB from the dataset using the >>>> dataAdapter.upd ate sub, I get an error. >>> >>> If you cannot modify the database, why bother trying to update >>> it? This would be my first red flag. >>> >>>> I've been able to work around this design flaw 'till now but it >>>> looks like the update sub can't handle it. >>> >>> Every once in a while, someone makes a column or other object in >>> a database whose name is a reserved word. SQL Server will let >>> you refer to this if >> you >>> enclose the object's identifier in square brackets: >>> >>> SELECT [Desc] FROM t_SomeTable >>> >>> Sometimes, SQL Server will understand what you mean if you >>> qualify the item you are referring to: >>> >>> SELECT t_SomeTable.Des c FROM t_SomeTable >>> >>> Another thing you might consider, though I personally don't like it is >> this: >>> >>> SET QUOTED_IDENTIFI ER ON >>> SELECT "Desc" FROM t_SomeTable >>> SET QUOTED_IDENTIFI ER OFF >>> >>> Generally speaking, the SQL Server Query Analyzer is your best >>> friend for figuring out correct SQL syntax irrespective of >>> application code. Once you get the SQL syntax to do the right >>> thing in Query Analyzer, then try it > in >>> your application code. If it then doesn't work, there is >>> something else going wrong, such as runtime permissions or other >>> screwy application stuff. -- >>> Peace & happy computing, >>> >>> Mike Labosh, MCSD MCT >>> Owner, vbSensei.Com >>> "Escriba coda ergo sum." -- vbSensei
Regards - OHM# On**********@BT Internet.com
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ms.net |
last post by:
I am writing application using Access Database....
Everything work on my PC. update, add,or delete.
Since the application is multiuser, i put the database on network.....
Application start without problem but i realize that some of tables doesn't
GET UPDATE. Dataadapter doesn't insert new row to some of my table. some of
them work. strange is that i check Haserrors of each datatable and
everything is FALSE. no error, no insertion.....
|
by: Webgour |
last post by:
So basically, I have an autoincremented primary key, so basically I set the
selectcommand, and then used SqlCommandBuilder to build the rest. The
problem is that when I do dataadapter's update to create new rows, it will
automatically insert the values of the row into the datatable, however,
since one of the fields is an autoincremented field, it has to be null on
the datarow. So after it inserts, it is still null on the datarow, while in...
|
by: !!bogus |
last post by:
Hi,
This is partial code. I am trying to update the table, but it is not working
and I am not sure why. Can you please help? I don't get any errors, but the
table is not updated. I am sure I am missing something
Thank you
Dim cnNewMember As SqlConnection = New
SqlConnection(Constants.ConnectionString)
|
by: rriness |
last post by:
I'm getting an inconsistent failure when trying to save
data in ADO.Net.
I'm using an Access database with a simple query - SELECT
StudentID, FirstName, LastName FROM Students - and have
no other users in the database. I keep getting the
message 'Operation must use an updateable query.'
Process seems to work on some PC's, not others. Is there
a difference in .Net framework versions? Or some other
|
by: Parveen |
last post by:
I have a data grid that's bound to a table in my dataset. After inserting a new row
into the grid and populating it with data, I go to save my changes. My data adapter
update command returns an error telling me that the last field that I populated has
a value of NULL. If I wait a few seconds and try to save my changes again, then
everything works fine. Somehow, now the adapter sees the populated data in this
field. Does anyone know why...
| |
by: Adam |
last post by:
This is kind of a tough question, but, I'm working on a
program now and using sql data adapters with sql server to
generate data tables.
I'm updating the tables and then using the
dataadapter.update method to send the table back.
The problem is, the tables have about 30 fields and I'm
only changing 2 (it's a holding file).
Can I make an update statement that will only send back
|
by: pooba53 |
last post by:
I have a VB .NET application that is communicating properly with an Access DB. I have a slew of textbox controls bound to a dataset and when the application launches, the fields are correctly populated.
If someone changes a value in one of the text boxes, I need to have a button capture the change and commit the update to Access. I know I'm close, but something is missing. I have a data adapter called:
OleDbDataAdapter1
and a dataset...
|
by: Mustaf Kazi |
last post by:
hi,
I tried to update record using data table and dataadapter
but I get error for line (in edit case)
daadapter1.update(dtTable1)
the error is
"Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."
|
by: mwenz |
last post by:
I am trying to update an Access table using OLEDB in VB.Net 2005. I can add rows but I cannot update them.
Code to instantiate the Access database and table...
Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & db.Name)
conn.Open()
Dim oda As New OleDb.OleDbDataAdapter("select " & sqlCols & " from ;", conn)
Dim cb As New OleDb.OleDbCommandBuilder(oda)
cb.QuotePrefix = ""
oda.UpdateCommand =...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |