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
How can you check whether a record is valid record or Invalid record using ADO control or Object?
What is the use of Data Form Wizard?
Types of ActiveX Components in VB?
How would you use ActiveX Dll and ActiveX Exe in your application?
What is the default workspace?
Where can I get updated VB and other Microsoft files?
What is Internet Explorer and its uses?
State about the different types of visual basic data?
which method used to move a recordset pointer in nth position in DAG?
What do you know about user forms.
I have several megabytes of memory. Why do I get an "out of memory" error?
How can you filter out specific type of file using file system controls?
Draw Sequence Modal of RDO? Explain.
How can you Add API functions to your Application?
What are 3 main differences between flexgrid control and dbgrid control?