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 Scalewidth and ScaleHeight Proeperty?

0 Answers  


What is visual basic used for?

0 Answers  


How should dates be implemented so they work with other language and country formats?

0 Answers  


Explain the types of Views in Listview Control?

0 Answers   Hella,


Is visual basic c#?

0 Answers  






Through which protocol OLEDB components are interfaced?

0 Answers  


How does VB Pass arguments to a function by default?

2 Answers  


Explain the differences between ActiveX Dll and ActiveX Exe?

0 Answers  


What is ado data control in vb?

0 Answers  


How do I mimic a toggle button?

0 Answers  


How do I make an animated icon for my program?

0 Answers  


Which ADO object is used to perform commit / rollback ? Is it command or connection or recordset I am not sure of the options given. So please let me know the answer if it is something else.

4 Answers   Infosys,


Categories