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

Explain public assembly?

0 Answers  


What is the difference between vb 6 and vb.net?

0 Answers  


hi,everyone. i got a problem in handling linklabels. i've more than one linklabels in a form. i used following event handler to handle the event 'LinkClicked' of Linklabel. private sub LinkLabel1_LinkClicked() Handles LinkLabel1.LinkClicked,LinkLabel2.LinkClicked ............... .......... end sub My question is how to identify the 'Linklabel1' and 'Linklabel2'. i dont want to handle the events of linklabels individually.

1 Answers  


Name some of the features present in vb 2005?

0 Answers  


What is sorting in vb?

0 Answers  






Why is the xml infoset specification different from the xml dom?

0 Answers  


Write a VB.Net console program to check whether a number is perfect or not.

1 Answers   Wipro,


How to run a dos command in vb.net?

0 Answers  


What is early binding?

0 Answers  


Explain the use of console application?

0 Answers  


What is the significance of delegates. Where should they be used?

0 Answers  


What is difference between inline and code behind?

0 Answers  


Categories