Click here to Skip to main content
16,014,952 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Unable to connect to Active Directory via SSL using VB.net Pin
Dave Kreskowiak17-Oct-07 15:16
mveDave Kreskowiak17-Oct-07 15:16 
GeneralRe: Unable to connect to Active Directory via SSL using VB.net Pin
Daniel Chew17-Oct-07 16:21
Daniel Chew17-Oct-07 16:21 
QuestionXml scchema and data tables Pin
JonCox16-Oct-07 22:35
JonCox16-Oct-07 22:35 
AnswerRe: Xml scchema and data tables Pin
Dave Kreskowiak17-Oct-07 15:14
mveDave Kreskowiak17-Oct-07 15:14 
QuestionSQL Check if a record exists Pin
The ANZAC16-Oct-07 22:00
The ANZAC16-Oct-07 22:00 
AnswerRe: SQL Check if a record exists Pin
Tom Deketelaere16-Oct-07 22:38
professionalTom Deketelaere16-Oct-07 22:38 
GeneralRe: SQL Check if a record exists Pin
The ANZAC17-Oct-07 0:08
The ANZAC17-Oct-07 0:08 
AnswerRe: SQL Check if a record exists Pin
Vimalsoft(Pty) Ltd16-Oct-07 22:47
professionalVimalsoft(Pty) Ltd16-Oct-07 22:47 
HI The ANZAC

Follow me. Lets say i have a textbox in my form and i want to see if there is a user name that Exist in my table "Users", and am using VB.NET. the First thing is to set up the adapter. you must tell the adapter that you going to Accept inputs from users. e.g

SELECT  USERS FROM MYTABLE WHERE (USERNAME = @USERNAME) 



When you are done with that create a dataset and Fill your dataset with Data like this.

myadapter.Fill(mydataset)


After that , you need to call this from your form.
in your form put in a Button , call it "btnSearch", and in the button click event write the Following code.

try

myadapter.SelectCommand.Parameters("@Username").Value = txtUsername.Text
            mydataset.Clear()
           myadapter.Fill( mydataset, "MYTable")
            If mydataset.Tables("MYTable").Rows.Count = 0 Then
                MessageBox.Show("The USERNAME does not Exist in the Database you can Continue Add it", "Info", MessageBoxButtons.OK)
            Else
                MessageBox.Show("The Property Exist in the Database, you cannot Add this liskey", "Error", MessageBoxButtons.OK)
            End If
        Catch ex As SqlClient.SqlException
            MessageBox.Show(ex.Message)
        End Try


Hope this Helps, if doesnt TEll me


Vuyiswa Maseko,

Sorrow is Better than Laughter, it may Sudden your Face, but It sharpens your Understanding

VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za


GeneralRe: SQL Check if a record exists Pin
The ANZAC17-Oct-07 0:04
The ANZAC17-Oct-07 0:04 
GeneralRe: SQL Check if a record exists Pin
Vimalsoft(Pty) Ltd17-Oct-07 0:24
professionalVimalsoft(Pty) Ltd17-Oct-07 0:24 
GeneralRe: SQL Check if a record exists Pin
The ANZAC17-Oct-07 0:49
The ANZAC17-Oct-07 0:49 
GeneralRe: SQL Check if a record exists Pin
Vimalsoft(Pty) Ltd17-Oct-07 1:41
professionalVimalsoft(Pty) Ltd17-Oct-07 1:41 
QuestionHow to send and receive e-mails in windows application? Pin
hgs24shravgi16-Oct-07 21:08
hgs24shravgi16-Oct-07 21:08 
AnswerRe: How to send and receive e-mails in windows application? Pin
Salman Sheikh16-Oct-07 21:24
Salman Sheikh16-Oct-07 21:24 
AnswerRe: How to send and receive e-mails in windows application? Pin
Steven J Jowett17-Oct-07 1:37
Steven J Jowett17-Oct-07 1:37 
GeneralRe: How to send and receive e-mails in windows application? Pin
hgs24shravgi17-Oct-07 20:36
hgs24shravgi17-Oct-07 20:36 
GeneralRe: How to send and receive e-mails in windows application? Pin
hgs24shravgi19-Oct-07 0:12
hgs24shravgi19-Oct-07 0:12 
Questiondata insertion Pin
BasharatAli16-Oct-07 21:06
BasharatAli16-Oct-07 21:06 
AnswerRe: data insertion Pin
Salman Sheikh16-Oct-07 21:26
Salman Sheikh16-Oct-07 21:26 
GeneralRe: data insertion Pin
BasharatAli16-Oct-07 21:28
BasharatAli16-Oct-07 21:28 
QuestionHow to run a DOS process and get ErrorLevel Pin
edmonson16-Oct-07 20:53
edmonson16-Oct-07 20:53 
AnswerRe: How to run a DOS process and get ErrorLevel Pin
Luc Pattyn17-Oct-07 2:39
sitebuilderLuc Pattyn17-Oct-07 2:39 
QuestionHow To Use ? Pin
Satish_S16-Oct-07 20:03
Satish_S16-Oct-07 20:03 
AnswerRe: How To Use ? Pin
Vimalsoft(Pty) Ltd16-Oct-07 21:06
professionalVimalsoft(Pty) Ltd16-Oct-07 21:06 
Questionhow to do datecalculations? Pin
sathyan_829416-Oct-07 19:56
sathyan_829416-Oct-07 19:56 

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.