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

Can you create a tabletype of recordset in Jet connected ODBC dbengine.

1567


How do I get the number of free bytes on a disk?

1305


Specify technical & functional architecture of your last 2 projects.

1716


How to down load image properties.

689


____ property of menu cannot be set at run time.

1259






How many ways you can access file using VB?

659


How can I access a record by record number?

1141


What do you know about user forms.

764


how to make unlimited id(1rimjim,2rimjim,3rimjim....etc) login grp chat pogram for jabber?

2076


How many File System Controls are there ? Explain.

1647


Explain the usage of Web Browser Control?

1582


What is ActiveX Control?

1862


What are the properties of datacontrol?

1612


what are the Default cursor Type and LockEdit type in DAO?

1826


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

1205