How to compare inserted text in (textbox1.text) with
existing database value in (Sqldatasource1) in visual
studio 2005 ?



How to compare inserted text in (textbox1.text) with existing database value in (Sqldatasource1) i..

Answer / amol

Dim strValue As String
strValue = txtValue1.Text

Dim rstData As ADODB.Recordset
rstData = New ADODB.Recordset

rstData.Fields.Append("A",
ADODB.DataTypeEnum.adInteger, 0,
ADODB.FieldAttributeEnum.adFldKeyColumn)
rstData.Fields.Append("B",
ADODB.DataTypeEnum.adVarChar, 10,
ADODB.FieldAttributeEnum.adFldIsNullable)
'rstData.Fields.Append("C",
ADODB.DataTypeEnum.adVarChar, 0)

rstData.Open()
rstData.AddNew()
rstData.Fields("A").Value = "1"
rstData.Fields("B").Value = "Amol"
rstData.Update()
rstData.MoveFirst()
If UCase(Trim(rstData.Fields("B").Value)) =
UCase(Trim(strValue)) Then
MsgBox("True")
Else
MsgBox("False")
End If

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More Visual Basic Interview Questions

What is diff between the Generic Variable and Specific Variable?

1 Answers  


what database you used in project?

2 Answers   Satyam,


What is the use of command Object?

2 Answers  


What is instantiating?

1 Answers  


Specify technical & functional architecture of your last 2 projects.

0 Answers  


How can we find out that a recordset is blank (without using recordcount property)?

4 Answers  


Describe Database Connection pooling relative to MTS ?

1 Answers  


how to use unicode data in vb6 regarding to telugu language, my output is in only telugu language

1 Answers  


How would you define and use a Boolean in VB?

2 Answers   Asteroid Software Services, Microsoft,


How do I make the mouse cursor invisible/visible?

0 Answers  


What are the different cursor types that can we create using ADO Recordset? Difference between these cursor types?

2 Answers  


what you know about databases?

2 Answers   Satyam,


Categories