sir i want to ask you that how can i fetch or get sql data
into texboxes.where i want to show record in specific
texboxes related to student information.when i click on
button all data show on texboxes when i put id or name
plz inform me on my id



sir i want to ask you that how can i fetch or get sql data into texboxes.where i want to show recor..

Answer / amit dixit

1)Create an object of CurrencyManager.
2)Take the values fetch from the table to DataView.
3)Convert dataview to type of Currency Manager.
eg:EMP Table.
Dim da As New SqlDataAdapter("SELECT * FROM EMP", sqlCon)
Dim ds As DataSet
Dim dv As DataView
Dim objCm As CurrencyManager
======================
ds = New DataSet
da.Fill(ds, "EMP")
dv = New DataView(ds.Tables("EMP"))
objCm = CType(Me.BindingContext(dv), CurrencyManager)
======================
txtEmpid.DataBindings.Clear()
txtFnm.DataBindings.Clear()
txtDeptno.DataBindings.Clear()
txtEmpid.DataBindings.Add("Text", dv, "EmpId")
txtFnm.DataBindings.Add("Text", dv, "FirstName")
txtDeptno.DataBindings.Add("Text", dv, "DeptNo")

You can iterate through the next and previous by using
Position property of CurrencyManager.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More VB.NET Interview Questions

Can you please explain the difference between c# and vb.net?

0 Answers  


Explain the use of new keyword?

0 Answers  


What is the use of console application?

0 Answers  


What is the Advantage of vb.net over vb

0 Answers   Digital GlobalSoft,


Explain the difference between value and reference types?

0 Answers  






What is the difference between Abstract Classes and Interfaces? Give the answer as a table format....

5 Answers  


How to view an assembly?

0 Answers  


There are three versions of VB6--Learning Edition, Professional and Enterprise. Is VB.Net similar?

1 Answers  


Name some different types of control?

0 Answers  


what are the advantage in vb.net and different between vb and vb.net

6 Answers   Data Entry Operator, Infosys, TCS, Zansa,


what is the need for dynamic controls in vb.net? i would like to know for what purpose should we create the controls dynamically? please give the answer in simple words.

0 Answers  


What is difference between import system.data.sqlclient,system.data.oledb?

0 Answers  


Categories