473,511 Members | 15,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to update,add,insert and delete rows in the database?

2 New Member
Hi,

I am using Vb.net and SQL2000.I am really confused how to update,delete,add,insert rows in the database.I like to use dataadapter and dataset.Kindly give me clear cut idea with the codes.

thanks in advance
Priya
Mar 31 '07 #1
1 904
1983prabu
1 New Member
update

Me.PictTableAdapter.UpdateQuery(TextBox7.Text, TextBox8.Text, TextBox9.Text, TextBox10.Text, TextBox11.Text, TextBox12.Text, ComboBox1.Text)
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)

save (the saving command using the picture save)


If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Then
MsgBox("plz fill the field")
Else
Dim ms As New MemoryStream
Dim path() As String = Split(TextBox3.Text, "\")
Array.Reverse(path)
PictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)
Dim img() As Byte = ms.GetBuffer
ms.Close()
Me.PictTableAdapter.InsertQuery(TextBox1.Text, img, TextBox3.Text, TextBox4.Text, TextBox5.Text, TextBox6.Text)
Try
MsgBox("saved", MsgBoxStyle.OkOnly, "Spares")
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)
TextBox1.Text = TextBox1.Text + 1
PictureBox1.ImageLocation = TextBox3.Text
PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
Catch ex As Exception
MsgBox("Error", MsgBoxStyle.OkOnly, "Spares")
End Try
End If

delete

Me.PictTableAdapter.DeleteQuery(ComboBox1.Text)
Me.PictTableAdapter.Fill(Me.PictureDataSet.pict)

picture-databasename
pict-tablename
Mar 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
16975
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...
16
3844
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...
25
4029
by: Neo Geshel | last post by:
This works: <form> <asp:TextBox id="name" /> <%= name.ClientID %> </form> But this DOES NOT work: <form>
4
2133
by: Jonathan Upright | last post by:
Greetings to anyone who can help: I'm using WebMatrix to make ASP.NET pages, and I chose the "Editable DataGrid" at the project selector screen. As you may know, it defaults to the Microsoft...
9
2865
by: DraguVaso | last post by:
Hi, I'm writing a VB.NET application who has to insert/update and delete a whole bunch of records from a File into a Sql Server Database. But I want to be able to knwo the 'result' of my ctions....
15
1949
by: graham | last post by:
Hi all, <bitching and moaning section> I am asking for any help I can get here... I am at the end of my tether... I don;t consider myself a genius in any way whatsoever, but I do believe I have...
4
4065
by: Ed L. | last post by:
I think I'm seeing table-level lock contention in the following function when I have many different concurrent callers, each with mutually distinct values for $1. Is there a way to reimplement...
30
3354
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and...
13
1863
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an...
3
3931
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
0
7153
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...
0
7371
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,...
0
7432
jinu1996
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...
0
5676
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,...
1
5077
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...
0
4743
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...
0
3230
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...
0
1583
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 ...
0
452
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...

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.