473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Insert, Update and Delete. Can somebody please help me?

Hello,

I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.

The update is not. I checked and my database has all the necessary
records in it when testing it. I get the error "No value given for one
or more required parameters." when I try to update the database.

Can you tell me what am I doing wrong?

Thanks,
Miguel

These are my 3 codes:

UPDATE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnection (connectionStri ng)

' Set Query and Command
Dim queryString As String = "UPDATE [t_news] SET [news_id]=@news_id,
[title_pt-PT]=@title_pt-PT, [title_en-GB]=@title_en-GB,
[text_pt-PT]=@text_pt-PT, [text_en-GB]=@text_en-GB,
[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
@news_id)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@news_id", 1))
.Add(New OleDbParameter( "@title_pt-PT", "Test UPDATE - title PT"))
.Add(New OleDbParameter( "@title_en-GB", "Test UPDATE - title EN"))
.Add(New OleDbParameter( "@text_pt-PT", "Test UPDATE - text PT"))
.Add(New OleDbParameter( "@text_en-GB", "Test UPDATE - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.To String("dd-MM-yyyy HH:mm:ss")))
End With

' Update Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try
INSERT

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnection (connectionStri ng)

' Set Query and Command
Dim queryString As String = "INSERT INTO [t_news] ([title_pt-PT],
[title_en-GB], [text_pt-PT], [text_en-GB], [publication_dat e]) VALUES
(@title_ptPT, @title_enGB, @text_ptPT, @text_enGB, @publication_da te)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@title_ptP T", "Test INSERT - title PT"))
.Add(New OleDbParameter( "@title_enG B", "Test INSERT - title EN"))
.Add(New OleDbParameter( "@text_ptPT ", "Test INSERT - text PT"))
.Add(New OleDbParameter( "@text_enGB ", "Test INSERT - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.To String("dd-MM-yyyy HH:mm:ss")))
End With

' Insert New Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try

DELETE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnection (connectionStri ng)

' Set Query and Command
Dim queryString As String = "DELETE FROM [t_news] WHERE
([t_news].[news_id] = @news_id)"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
dbCommand.Param eters.Add(New OleDbParameter( "@news_id", 2))

' Delete Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try

Nov 19 '05 #1
3 3449
Hi Miguel:

This is a Friday afternoon guess:

I believe with the OLE-DB provider parameters are based on position,
not name. Try adding an additional OleDbParameter for the @news_id in
the WHERE and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 8 Jul 2005 17:30:30 +0000, "Shapper"
<mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote:
Hello,

I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.

The update is not. I checked and my database has all the necessary
records in it when testing it. I get the error "No value given for one
or more required parameters." when I try to update the database.

Can you tell me what am I doing wrong?

Thanks,
Miguel

These are my 3 codes:

UPDATE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "UPDATE [t_news] SET [news_id]=@news_id,
[title_pt-PT]=@title_pt-PT, [title_en-GB]=@title_en-GB,
[text_pt-PT]=@text_pt-PT, [text_en-GB]=@text_en-GB,
[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
@news_id)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@news_id", 1))
.Add(New OleDbParameter( "@title_pt-PT", "Test UPDATE - title PT"))
.Add(New OleDbParameter( "@title_en-GB", "Test UPDATE - title EN"))
.Add(New OleDbParameter( "@text_pt-PT", "Test UPDATE - text PT"))
.Add(New OleDbParameter( "@text_en-GB", "Test UPDATE - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
End With

' Update Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try
INSERT

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "INSERT INTO [t_news] ([title_pt-PT],
[title_en-GB], [text_pt-PT], [text_en-GB], [publication_dat e]) VALUES
(@title_ptPT , @title_enGB, @text_ptPT, @text_enGB, @publication_da te)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@title_ptP T", "Test INSERT - title PT"))
.Add(New OleDbParameter( "@title_enG B", "Test INSERT - title EN"))
.Add(New OleDbParameter( "@text_ptPT ", "Test INSERT - text PT"))
.Add(New OleDbParameter( "@text_enGB ", "Test INSERT - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
End With

' Insert New Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try

DELETE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "DELETE FROM [t_news] WHERE
([t_news].[news_id] = @news_id)"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ol eDb.OleDbComman d
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
dbCommand.Param eters.Add(New OleDbParameter( "@news_id", 2))

' Delete Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try


Nov 19 '05 #2
Hi,

I did that:

' Set Query and Command
Dim queryString As String = "UPDATE [t_news] SET
[news_id]=@news_id_updat e, [title_pt-PT]=@title_ptPT,
[title_en-GB]=@title_enGB, [text_pt-PT]=@text_ptPT,
[text_en-GB]=@text_enGB, [publication_dat e]=@publication_d ate WHERE
([t_news].[news_id] = @news_id)"
...
' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@news_id_updat e", 5))
.Add(New OleDbParameter( "@news_id", 5))
.Add(New OleDbParameter( "@title_ptP T", "Test UPDATE - title PT"))
.Add(New OleDbParameter( "@title_enG B", "Test UPDATE - title EN"))
.Add(New OleDbParameter( "@text_ptPT ", "Test UPDATE - text PT"))
.Add(New OleDbParameter( "@text_enGB ", "Test UPDATE - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.To String("dd-MM-yyyy HH:mm:ss")))
End With

I get the error: "Cannot update 'news_id'; field not updateable."

Remember that news_id is the primary key on my Access database and set
as "AutoNumber "

Then I tried the following query as i don't need to change the news_id
field:
Dim queryString As String = "UPDATE [t_news] SET
[title_pt-PT]=@title_ptPT, [title_en-GB]=@title_enGB,
[text_pt-PT]=@text_ptPT, [text_en-GB]=@text_enGB,
[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
@news_id)"

I don't get any error but there is no change in data!!!! And record 5 is
there!

I even placed a Response.Write( "Done") in the code:

' Update Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
Response.Write( "Done")
End Try

And it is displayed "DONE"!

My INSERT and DELETE codes are working fine.

What is going on with this UPDATE code?

Thanks,
Miguel

"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:sc***@nosp am.odetocode.co m:
Hi Miguel:

This is a Friday afternoon guess:

I believe with the OLE-DB provider parameters are based on position,
not name. Try adding an additional OleDbParameter for the @news_id in
the WHERE and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 8 Jul 2005 17:30:30 +0000, "Shapper"
<mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote:

Hello,

I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.

The update is not. I checked and my database has all the necessary
records in it when testing it. I get the error "No value given for one
or more required parameters." when I try to update the database.

Can you tell me what am I doing wrong?

Thanks,
Miguel

These are my 3 codes:

UPDATE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "UPDATE [t_news] SET [news_id]=@news_id,
[title_pt-PT]=@title_pt-PT, [title_en-GB]=@title_en-GB,
[text_pt-PT]=@text_pt-PT, [text_en-GB]=@text_en-GB,
[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
@news_id)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@news_id", 1))
.Add(New OleDbParameter( "@title_pt-PT", "Test UPDATE - title PT"))
.Add(New OleDbParameter( "@title_en-GB", "Test UPDATE - title EN"))
.Add(New OleDbParameter( "@text_pt-PT", "Test UPDATE - text PT"))
.Add(New OleDbParameter( "@text_en-GB", "Test UPDATE - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
End With

' Update Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try
INSERT

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "INSERT INTO [t_news] ([title_pt-PT],
[title_en-GB], [text_pt-PT], [text_en-GB], [publication_dat e]) VALUES
(@title_ptPT , @title_enGB, @text_ptPT, @text_enGB, @publication_da te)"
Dim dbCommand As IDbCommand = New OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@title_ptP T", "Test INSERT - title PT"))
.Add(New OleDbParameter( "@title_enG B", "Test INSERT - title EN"))
.Add(New OleDbParameter( "@text_ptPT ", "Test INSERT - text PT"))
.Add(New OleDbParameter( "@text_enGB ", "Test INSERT - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
End With

' Insert New Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try

DELETE

' Set Connection
Dim connectionStrin g As String = AppSettings("co nnectionString" )
Dim dbConnection As IDbConnection = New
OleDbConnectio n(connectionStr ing)

' Set Query and Command
Dim queryString As String = "DELETE FROM [t_news] WHERE
([t_news].[news_id] = @news_id)"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ol eDb.OleDbComman d
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

' Add Parameters
dbCommand.Param eters.Add(New OleDbParameter( "@news_id", 2))

' Delete Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
End Try


Nov 19 '05 #3
The @news_id parameter is getting populated with the publication date
- so the UPDATE statement never finds the record. As I mentioned in
the first reply, parameters are resolved by position for the OleDb
provider.

In other words:

OleDbParameters are not resolved by name.

OleDbParameters are resolved in the order they are added to the
OleDbCommand.

If your UPDATE looks like this:

UPDATE [t_news]
SET
[title_pt-PT]=@title_ptPT,
[title_en-GB]=@title_enGB,
[text_pt-PT]=@text_ptPT,
[text_en-GB]=@text_enGB,
[publication_dat e]=@publication_d ate
WHERE ([t_news].[news_id] = @news_id

Then you need to add to dbCommand.Param eters in the same order the
params appear in the query:

..Add(New OleDbParameter( "@title_ptP T", "Test UPDATE - title PT"))
..Add(New OleDbParameter( "@title_enG B", "Test UPDATE - title EN"))
'
' other params
'
..Add(New OleDbParameter( "@news_id", 5))

HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 8 Jul 2005 22:20:26 +0000, "Shapper"
<mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote:
Hi,

I did that:

' Set Query and Command
Dim queryString As String = "UPDATE [t_news] SET
[news_id]=@news_id_updat e, [title_pt-PT]=@title_ptPT,
[title_en-GB]=@title_enGB, [text_pt-PT]=@text_ptPT,
[text_en-GB]=@text_enGB, [publication_dat e]=@publication_d ate WHERE
([t_news].[news_id] = @news_id)"
...
' Add Parameters
With dbCommand.Param eters
.Add(New OleDbParameter( "@news_id_updat e", 5))
.Add(New OleDbParameter( "@news_id", 5))
.Add(New OleDbParameter( "@title_ptP T", "Test UPDATE - title PT"))
.Add(New OleDbParameter( "@title_enG B", "Test UPDATE - title EN"))
.Add(New OleDbParameter( "@text_ptPT ", "Test UPDATE - text PT"))
.Add(New OleDbParameter( "@text_enGB ", "Test UPDATE - text EN"))
.Add(New OleDbParameter( "@publication_d ate",
DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
End With

I get the error: "Cannot update 'news_id'; field not updateable."

Remember that news_id is the primary key on my Access database and set
as "AutoNumber "

Then I tried the following query as i don't need to change the news_id
field:
Dim queryString As String = "UPDATE [t_news] SET
[title_pt-PT]=@title_ptPT, [title_en-GB]=@title_enGB,
[text_pt-PT]=@text_ptPT, [text_en-GB]=@text_enGB,
[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
@news_id)"

I don't get any error but there is no change in data!!!! And record 5 is
there!

I even placed a Response.Write( "Done") in the code:

' Update Record
dbConnection.Op en()
Try
dbCommand.Execu teNonQuery()
Finally
dbConnection.Cl ose()
Response.Write( "Done")
End Try

And it is displayed "DONE"!

My INSERT and DELETE codes are working fine.

What is going on with this UPDATE code?

Thanks,
Miguel

"Scott Allen" <sc***@nospam.o detocode.com> wrote in message
news:sc***@nos pam.odetocode.c om:
Hi Miguel:

This is a Friday afternoon guess:

I believe with the OLE-DB provider parameters are based on position,
not name. Try adding an additional OleDbParameter for the @news_id in
the WHERE and see what happens.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 8 Jul 2005 17:30:30 +0000, "Shapper"
<mdmoura*NOSPAM *@gmail.*DELETE 2SEND*com> wrote:

>Hello,
>
>I have created 3 functions to insert, update and delete an Access
>database record. The Insert and the Delete code are working fine.
>
>The update is not. I checked and my database has all the necessary
>records in it when testing it. I get the error "No value given for one
>or more required parameters." when I try to update the database.
>
>Can you tell me what am I doing wrong?
>
>Thanks,
>Miguel
>
>These are my 3 codes:
>
>UPDATE
>
> ' Set Connection
> Dim connectionStrin g As String = AppSettings("co nnectionString" )
> Dim dbConnection As IDbConnection = New
>OleDbConnectio n(connectionStr ing)
>
> ' Set Query and Command
> Dim queryString As String = "UPDATE [t_news] SET [news_id]=@news_id,
>[title_pt-PT]=@title_pt-PT, [title_en-GB]=@title_en-GB,
>[text_pt-PT]=@text_pt-PT, [text_en-GB]=@text_en-GB,
>[publication_dat e]=@publication_d ate WHERE ([t_news].[news_id] =
>@news_id)"
> Dim dbCommand As IDbCommand = New OleDbCommand
> dbCommand.Comma ndText = queryString
> dbCommand.Conne ction = dbConnection
>
> ' Add Parameters
> With dbCommand.Param eters
> .Add(New OleDbParameter( "@news_id", 1))
> .Add(New OleDbParameter( "@title_pt-PT", "Test UPDATE - title PT"))
> .Add(New OleDbParameter( "@title_en-GB", "Test UPDATE - title EN"))
> .Add(New OleDbParameter( "@text_pt-PT", "Test UPDATE - text PT"))
> .Add(New OleDbParameter( "@text_en-GB", "Test UPDATE - text EN"))
> .Add(New OleDbParameter( "@publication_d ate",
>DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
> End With
>
> ' Update Record
> dbConnection.Op en()
> Try
> dbCommand.Execu teNonQuery()
> Finally
> dbConnection.Cl ose()
> End Try
>
>
>INSERT
>
> ' Set Connection
> Dim connectionStrin g As String = AppSettings("co nnectionString" )
> Dim dbConnection As IDbConnection = New
>OleDbConnectio n(connectionStr ing)
>
> ' Set Query and Command
> Dim queryString As String = "INSERT INTO [t_news] ([title_pt-PT],
>[title_en-GB], [text_pt-PT], [text_en-GB], [publication_dat e]) VALUES
>(@title_ptPT , @title_enGB, @text_ptPT, @text_enGB, @publication_da te)"
> Dim dbCommand As IDbCommand = New OleDbCommand
> dbCommand.Comma ndText = queryString
> dbCommand.Conne ction = dbConnection
>
> ' Add Parameters
> With dbCommand.Param eters
> .Add(New OleDbParameter( "@title_ptP T", "Test INSERT - title PT"))
> .Add(New OleDbParameter( "@title_enG B", "Test INSERT - title EN"))
> .Add(New OleDbParameter( "@text_ptPT ", "Test INSERT - text PT"))
> .Add(New OleDbParameter( "@text_enGB ", "Test INSERT - text EN"))
> .Add(New OleDbParameter( "@publication_d ate",
>DateTime.Now.T oString("dd-MM-yyyy HH:mm:ss")))
> End With
>
> ' Insert New Record
> dbConnection.Op en()
> Try
> dbCommand.Execu teNonQuery()
> Finally
> dbConnection.Cl ose()
> End Try
>
>DELETE
>
> ' Set Connection
> Dim connectionStrin g As String = AppSettings("co nnectionString" )
> Dim dbConnection As IDbConnection = New
>OleDbConnectio n(connectionStr ing)
>
> ' Set Query and Command
> Dim queryString As String = "DELETE FROM [t_news] WHERE
>([t_news].[news_id] = @news_id)"
> Dim dbCommand As System.Data.IDb Command = New
>System.Data.Ol eDb.OleDbComman d
> dbCommand.Comma ndText = queryString
> dbCommand.Conne ction = dbConnection
>
> ' Add Parameters
> dbCommand.Param eters.Add(New OleDbParameter( "@news_id", 2))
>
> ' Delete Record
> dbConnection.Op en()
> Try
> dbCommand.Execu teNonQuery()
> Finally
> dbConnection.Cl ose()
> End Try
>
>


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
17015
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums must be UPDATED, if not, they must be INSERTED. Logically then, I would like to SELECT * FROM <TABLE> WHERE ....<Values entered here>, and then IF FOUND UPDATE <TABLE> SET .... <Values entered here> ELSE INSERT INTO <TABLE> VALUES <Values...
16
3874
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but couldn't find anything. the context: we have some java folk who like to parametize/
4
1512
by: Diana Estrada | last post by:
Hi, I have a store procedure to insert , and I use tableadapter to execute this store procedure, when I run the application and execute the sp , works ok and after I see the datagridview and the new row is there, but the problem ir that when I stop the application and look my database in SQL Server 2005 the table don´t have the new row. Somebody knows why? or Any idea to execute the store procedure to insert or delete or update rows in...
10
4589
by: Ivan | last post by:
Hi to all !!! I have one stored procedure that update and delete rows in differents tables, but when I try of delete of the main table this show problems with primary and foreign key. I DROP these keys and after AD these keys, but I need make this in one stored procedure but show problems when run this. I can make this in one stored procedure? This is the estored procedure
1
6209
by: abhi81 | last post by:
Hello All, I have a table on which I have created a insert,Update and a Delete trigger. All these triggers write a entry to another audit table with the unique key for each table and the timestamp. Insert and Update trigger work fine when i have only one of them defined. However when I have all the 3 triggers in place and when i try to fire a insert query on the statement. It triggers both insert and update trigger at the same time and...
4
4862
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a sql DataAdapter (da) da.SelectCommand.CommandText = "Select * from Servertbl1" da.Fill(ds, "tbl1") so far, so good. If I add a row to the datagridview I use the following sqlDataAdapter code to update the server table - which works OK when...
0
2289
by: magnolia | last post by:
i created a trigger that will record the changes made to a table .everything works fine except the insert query.whenerever i try to insert a record it fires insert and update triger at the same time which means i hav 2 record for every insert operation. any help appreciated. thank u herez teh code i tried. ALTER TRIGGER trg_ContactAddress_Audit ON Address FOR DELETE, INSERT, UPDATE AS
1
2279
by: veasnamuch | last post by:
I have a problem while I create a trigger to my table. My objective is getting any change made to my table and record it in to another table . My have thousands records before I add new trigger to this table, everything work fine means, when I manual insert data into table the last row of inserting is what I am doing but after I add trigger on inserting to this table and I do next manual insert data into the last row in Enterprise Manager, I...
0
1314
by: Michael | last post by:
I know I am missing something simple, but I am stuck. When I submit the following for the employee info gets stored in scale1 and scale1 shows the employee number. Can someone show me my mistake. Thanks. Code: <%@ Page Language="VB" %>
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
Oralloy
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...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
agi2029
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...
1
6751
isladogs
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...
0
6053
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();...
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.