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 the-use of property page Wizard in ActiveX Control?

0 Answers  


How to find the current record position in data control?

2 Answers  


What are the important components of OLEDB?

0 Answers  


What is the use of command Object?

3 Answers   Arigo Infotech, Microsoft,


To find the current recordposition in data control.

0 Answers  






what is the Difference between Query unload and unload in form?

1 Answers  


What are the differences between a standard module and a class module?

4 Answers  


What are 3 main differences between flexgrid control and dbgrid control?

0 Answers  


What is DAO?

2 Answers  


what are the Types of Modal windows in VB?

1 Answers  


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

0 Answers  


How much gain in performance will I get if I write my number crunching routines in C instead of Visual Basic?

0 Answers  


Categories