Click here to Skip to main content
15,916,692 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Problem with Modal Form Pin
Rupesh Kumar Swami19-Sep-08 4:51
Rupesh Kumar Swami19-Sep-08 4:51 
Questiondatagridviewcomboboxcell Pin
WhiteGirl2319-Sep-08 2:28
WhiteGirl2319-Sep-08 2:28 
QuestionTranperancy Pin
~V~19-Sep-08 1:23
~V~19-Sep-08 1:23 
AnswerRe: Tranperancy Pin
Gagan.2019-Sep-08 5:29
Gagan.2019-Sep-08 5:29 
GeneralRe: Tranperancy Pin
~V~19-Sep-08 20:45
~V~19-Sep-08 20:45 
GeneralRe: Tranperancy Pin
Gagan.2020-Sep-08 4:25
Gagan.2020-Sep-08 4:25 
GeneralRe: Tranperancy Pin
Dave Kreskowiak20-Sep-08 7:50
mveDave Kreskowiak20-Sep-08 7:50 
QuestionFormatting a datetime value returns 0 instead of the month number Pin
Hans vd Bovenkamp19-Sep-08 0:02
Hans vd Bovenkamp19-Sep-08 0:02 
AnswerRe: Formatting a datetime value returns 0 instead of the month number Pin
Alan N19-Sep-08 0:50
Alan N19-Sep-08 0:50 
GeneralRe: Formatting a datetime value returns 0 instead of the month number Pin
Hans vd Bovenkamp19-Sep-08 0:56
Hans vd Bovenkamp19-Sep-08 0:56 
QuestionSQL & Flowcentric [modified] Pin
Ruan_B18-Sep-08 23:47
Ruan_B18-Sep-08 23:47 
AnswerRe: SQL & Flowcentric Pin
Dave Kreskowiak19-Sep-08 7:31
mveDave Kreskowiak19-Sep-08 7:31 
QuestionCommunicate between tcp and com port.. Pin
Subjugate18-Sep-08 19:36
Subjugate18-Sep-08 19:36 
AnswerRe: Communicate between tcp and com port.. Pin
jzonthemtn19-Sep-08 4:57
jzonthemtn19-Sep-08 4:57 
QuestionBinding whole data to listview at a time(lacks of data) Pin
pavanip18-Sep-08 19:13
pavanip18-Sep-08 19:13 
AnswerRe: Binding whole data to listview at a time(lacks of data) Pin
Dave Kreskowiak19-Sep-08 7:30
mveDave Kreskowiak19-Sep-08 7:30 
QuestionHow to get the IP address of the machine using Windows API in .NET Pin
SAHIBas18-Sep-08 18:53
SAHIBas18-Sep-08 18:53 
AnswerRe: How to get the IP address of the machine using Windows API in .NET Pin
jzonthemtn19-Sep-08 1:58
jzonthemtn19-Sep-08 1:58 
QuestionData saving problem? Pin
lahsiv18-Sep-08 8:11
lahsiv18-Sep-08 8:11 
#1 (permalink) Add to desperateboy's Reputation Report Post
Old Today, 1:09 PM
desperateboy desperateboy is online now
VB.NET Forum Newbie
.NET Framework: .NET 1.1 (VS 2003)

Join Date: Dec 2007
Posts: 20
Reputation: 12
desperateboy is on a distinguished programming path ahead
Default Insertion problem in database
hi friends,

I have added 3 buttons of name add,save and delete.When add username in the database first heck out that already exist or not.If not existed then insert into database.I trying using this code

Plz help to sort it out.

Try
dim str1 as string
str1 = txtusr.Text
conn.Open()
cmd = New SqlCommand("select * from usrs where uname='" & (str1) & "'", conn)
dr = cmd.ExecuteReader
While dr.Read()
str = dr.Item("uname")
If str <> Trim(str1) Then
usrexist()
Exit Sub
Else
Dim sYN As String
sYN = MsgBox("User Already Exists, Want to Update", vbYesNo + vbQuestion, "Update User")
If sYN = vbYes Then
'' update in the database''
End If

End While

Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd = Nothing
conn.Close()
dr.Close()
End Try
AnswerRe: Data saving problem? Pin
Paul Conrad18-Sep-08 11:27
professionalPaul Conrad18-Sep-08 11:27 
GeneralRe: Data saving problem? Pin
ChandraRam19-Sep-08 7:54
ChandraRam19-Sep-08 7:54 
GeneralRe: Data saving problem? Pin
lahsiv20-Sep-08 8:32
lahsiv20-Sep-08 8:32 
GeneralRe: Data saving problem? Pin
ChandraRam20-Sep-08 8:38
ChandraRam20-Sep-08 8:38 
GeneralRe: Data saving problem? Pin
lahsiv20-Sep-08 21:10
lahsiv20-Sep-08 21:10 
Questionvb.net Pin
sreenivi18-Sep-08 3:02
sreenivi18-Sep-08 3:02 

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.