|
-
Apr 13th, 2007, 01:26 PM
#1
Thread Starter
Addicted Member
how the can this be incrmented and inserted to table?
create table gir(idno integer unique, fname varchar(30))
insert into gir values(1,'mam')
then i want to enter name from an input form but the idno must enter internally by incrementing its previous values. means i have only one textbox to enter name ,but the idno should enter internally by incrementing the idno of its previous so how can i do this?
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim str As String
con = New SqlConnection("server=(local);database=master;uid=sa;pwd=test;")
cmd = New SqlCommand(str, con)
con.Open()
str = "insert into gir values('" & idno& "','" & txtfname.Text & "')"
cmd.CommandText = str
cmd.ExecuteNonQuery()
con.Close()
End Sub
how the value of idno number calculated?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|