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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you check whether a record is valid record or Invalid record using ADO control or Object?

1611


What is the use of Data Form Wizard?

1760


Types of ActiveX Components in VB?

1635


How would you use ActiveX Dll and ActiveX Exe in your application?

1738


What is the default workspace?

1714


Where can I get updated VB and other Microsoft files?

1232


What is Internet Explorer and its uses?

1993


State about the different types of visual basic data?

758


which method used to move a recordset pointer in nth position in DAG?

1763


What do you know about user forms.

897


I have several megabytes of memory. Why do I get an "out of memory" error?

1308


How can you filter out specific type of file using file system controls?

1602


Draw Sequence Modal of RDO? Explain.

1820


How can you Add API functions to your Application?

1542


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

2141