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
Explain the "cursortype" and "Locktype" in VB?
What is the use of Scalewidth and ScaleHeight Proeperty?
What is the default model of the form?
what are the Differences between ActiveX Control and Standard Control?
what is the Difference between Linked Object and Embedded Object?
How can you check whether a record is valid record or Invalid record using ADO control or Object?
Difference between Tabletype and Snapshot?
How would you add elements and pictures to listitems in listview control?
What is hyperlink?
Difference between Dynaset and Snapshot?
What is constructors and distructors.
What language does visual basic use?
What is script control?
What is data binding in vb net?
what are the types of cursors in DAO?