Click here to Skip to main content
15,908,661 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHELP!!! how can I connect to Oracle with this error?? [modified] Pin
meki_211810-Sep-08 17:08
meki_211810-Sep-08 17:08 
AnswerRe: HELP!!! how can I connect to Oracle with this error?? Pin
Gamzun10-Sep-08 18:31
Gamzun10-Sep-08 18:31 
GeneralRe: HELP!!! how can I connect to Oracle with this error?? Pin
meki_211810-Sep-08 21:37
meki_211810-Sep-08 21:37 
AnswerRe: HELP!!! how can I connect to Oracle with this error?? Pin
Rich.Edwards12-Sep-08 4:58
Rich.Edwards12-Sep-08 4:58 
QuestionEventLog problem ,,Vista Home Pin
Amr M. K.10-Sep-08 11:04
Amr M. K.10-Sep-08 11:04 
AnswerRe: EventLog problem ,,Vista Home Pin
Abhijit Jana10-Sep-08 18:51
professionalAbhijit Jana10-Sep-08 18:51 
GeneralRe: EventLog problem ,,Vista Home Pin
Amr M. K.11-Sep-08 1:22
Amr M. K.11-Sep-08 1:22 
Questionhow to check the username is already exist in a table...? Pin
asad_black10-Sep-08 9:34
asad_black10-Sep-08 9:34 
hi every one...!

em creating a create user account page.

i want to check the username is already exists in my database table or not?

if exists then give me a error message that username is already exists if not then account will be successfully create.

em using this code but its not work correctly..

i dont know whatz de problem. and please remember em using Access database.

please point out my mistakes.






Dim objConnection As OleDbConnection
Sub Page_Load(Source As Object, E As EventArgs)
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " _
& "DATA SOURCE=" _
& Server.MapPath("nwind.mdb;"))
End Sub




Sub btnInsert_Click(ByVal Sender As Object, ByVal E As EventArgs)

Dim query As String
query = "Select Count(*) From login Where username = ? "
Dim result As Integer = 0

If result > 0 Then



Dim strSQL As String = "INSERT INTO login (username, [password]) " & _
"VALUES (?, ?) "


Dim dbComm As New OleDbCommand(strSQL, objConnection)
dbComm.Parameters.Add("UserName", OleDbType.VarChar, 32, "UserName")
dbComm.Parameters.Add("Password", OleDbType.VarChar, 128, "Password")

dbComm.Parameters("UserName").Value = txtUserName.Text
dbComm.Parameters("Password").Value = txtPassword.Text

Try
objConnection.Open()
dbComm.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
Finally
If objConnection.State = ConnectionState.Open Then
objConnection.Close()
End If
End Try

Response.Write("A new record has been added")
Response.End()


Else
Response.Write("your username is already exist")
End If


End Sub


AnswerRe: how to check the username is already exist in a table...? Pin
Christian Graus10-Sep-08 9:45
protectorChristian Graus10-Sep-08 9:45 
AnswerRe: how to check the username is already exist in a table...? Pin
Pete O'Hanlon10-Sep-08 10:36
mvePete O'Hanlon10-Sep-08 10:36 
AnswerRe: how to check the username is already exist in a table...? Pin
naveedmazhar10-Sep-08 18:14
naveedmazhar10-Sep-08 18:14 
QuestionError loading WebForm.aspx Pin
Reality Strikes10-Sep-08 8:33
Reality Strikes10-Sep-08 8:33 
Questionjavascript function call from user control's command button Pin
Neeraj Arora10-Sep-08 7:31
Neeraj Arora10-Sep-08 7:31 
AnswerRe: javascript function call from user control's command button Pin
Christian Graus10-Sep-08 8:07
protectorChristian Graus10-Sep-08 8:07 
GeneralRe: javascript function call from user control's command button Pin
Neeraj Arora10-Sep-08 8:15
Neeraj Arora10-Sep-08 8:15 
GeneralRe: javascript function call from user control's command button Pin
Christian Graus10-Sep-08 8:30
protectorChristian Graus10-Sep-08 8:30 
AnswerRe: javascript function call from user control's command button Pin
naveedmazhar10-Sep-08 18:24
naveedmazhar10-Sep-08 18:24 
QuestionChild Control Problem With Page_Load Pin
Brady Kelly10-Sep-08 7:10
Brady Kelly10-Sep-08 7:10 
QuestionHow can hide IE 7 vertical scrollbars? Pin
JUNEYT10-Sep-08 6:46
JUNEYT10-Sep-08 6:46 
AnswerRe: How can hide IE 7 vertical scrollbars? Pin
Christian Graus10-Sep-08 7:07
protectorChristian Graus10-Sep-08 7:07 
QuestionSend ArrayList to aspx page from Webservice Pin
huge_superman10-Sep-08 6:16
huge_superman10-Sep-08 6:16 
AnswerRe: Send ArrayList to aspx page from Webservice Pin
Christian Graus10-Sep-08 6:23
protectorChristian Graus10-Sep-08 6:23 
GeneralRe: Send ArrayList to aspx page from Webservice Pin
SomeGuyThatIsMe10-Sep-08 7:47
SomeGuyThatIsMe10-Sep-08 7:47 
GeneralRe: Send ArrayList to aspx page from Webservice Pin
Christian Graus10-Sep-08 8:06
protectorChristian Graus10-Sep-08 8:06 
JokeRe: Send ArrayList to aspx page from Webservice Pin
SomeGuyThatIsMe10-Sep-08 8:13
SomeGuyThatIsMe10-Sep-08 8:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.