hi,
i am creating website for online donation. I want donor id should auto generate when user will donate first time and only
registered member can donate.i have use this code to insert data in donate table but i want to generate id automatically.
the database has tables login, member,donate and feedback.
please help
Imports System.Data.SqlClient
Imports System.Data.DataSet
Partial Class Donate
Inherits System.Web.UI.Page
Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList1.SelectedIndexChanged
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = "Data Source=COMP-4\SQLEXPRESS;Initial Catalog=mesco;Integrated Security=True"
cmd.Connection = con
con.Open()
cmd.CommandText = "insert into <pre lang="vb">member(name,age,password,confirmpassword,email,secquestion,secanswer)values('" & txtUserName.Text() & "','" & txtAge.Text() & "','" & txtPassword.Text() & "','" & txtConfirmPassword.Text() & "','" & txtEmail.Text() & "','" & txtSecurityQuestion.Text() & "','" & txtSecurityAnswer.Text() & "')"
cmd.ExecuteNonQuery()
MsgBox("You have been successfully Register", MsgBoxStyle.Information)
If txtUserName.Text <> "" Then
Session("name") = txtUserName.Text
End If
If txtPassword.Text <> "" Then
Session("pass") = txtPassword.Text
End If
con.Close()
txtUserName.Text = " "
txtAge.Text = ""
txtPassword.Text = ""
txtConfirmPassword.Text = ""
txtEmail.Text = ""
txtSecurityQuestion.Text = ""
txtSecurityAnswer.Text = "
"
End Sub
End Class