Hi Frends,
Can I use View Insted of query in my code.
If yes Then plz tell me how can.
Protected Sub checkavailabilityusername(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles usersformview.ItemInserting
Dim name As TextBox
Dim username As String
Dim Query As String
Dim dr As SqlDataReader
Dim db As DBConnection
db = DBConnection.getConnection()
name = usersformview.FindControl("username")
username = name.Text
Query = "SELECT [username] FROM [customer] where [username] = '" & username & "' "
dr = db.executeQuery(Query)
If dr.Read = True Then
e.Cancel = True
errmsg.Text = "<h5 style='color:#270000;'> The User Name you have entered is already exists.Please enter another User Name.</h5>"
'Response.Write("<h4 color=red> The Country name you have entered is already exists.Please enter another the country name.</h4>")
End If
dr.Close()
End Sub
Thanks