Thanks for your reply eric,
ive tried that but i keep getting this error:
Exception Details: System.Data.Odbc.OdbcException: ERROR [07002] SQLBindParameter not used for all parameters
Source Error:
Line 39:
Line 40: conn.open()
Line 41: Cmd.ExecuteNonQuery()
Line 42: if count <> 0 then
Line 43: label1.text = "email already exists"
this is the code ive used:
Sub AddDetails_Click(s As Object, e As EventArgs)
dim count as integer
Cmd = New OdbcCommand ("INSERT INTO User (firstname, lastname, address1,address2,email,telno,pwd) VALUES (?, ?, ?,?,?,?,?)" ,conn)
Cmd.Parameters.Add("@firstname",odbctype.varchar,10).value = txtfirstname.text
Cmd.Parameters.Add("@lastname",odbctype.varchar,10).value = txtlastname.text
Cmd.Parameters.Add("@addr1",odbctype.varchar,20).value = txtaddress1.text
Cmd.Parameters.Add("@addr2",odbctype.varchar,20).value = txtaddress2.text
Cmd.Parameters.Add("@email",odbctype.varchar,20).value = txtemail.text
Cmd.Parameters.Add("@telno",odbctype.varchar,20).value = txttelno.text
Cmd.Parameters.Add("@pwd",odbctype.varchar,20).value = txtpassword.text
cmd = new odbccommand("select count (email) as total from researcher where email = ?",conn)
conn.open()
Cmd.ExecuteNonQuery()
if count <> 0 then
label1.text = "email already exists"
else
Response.Redirect("login.aspx")
Conn.Close()
end if
it doesnt give an initial error when i load the page,the error pops up after i click the button to submit the details to db
any ideas?