Loading

visual basic .net

Submitted by: 


hello Masters,

After Long time

I am start working with visual basic .net and i am new to it

also i did not join any class for learn vb.net

The Problem is call data in datagride view by programetically

I done in vb6 using listbox but now i want use datagrideview in vb.net but don't know how to do it

here is my code for list in vb6

but don't know in vb.net for data grideview

i use sqldatabase as database

hi there

i am new for vb.net

1. Private Sub Text1_Change()
2. If Len(Text1.Text) > 0 Then
3. List1.Visible = True
4. recordadd "companymaster", "companyname", Text1.Text, List1
5. Else
6. List1.Visible = False
7. End If
8.
9.
10. Public Sub recordadd(tabl As String, rsfield As String, s As String, l As ListBox)
11. Dim str As String
12. Dim strsql As String
13.
14. str = s & "%"
15. strsql = "select * from " & tabl & " where " & rsfield & " like '" & str & "' "
16.
17. If Len(str) > 0 Then
18. rs.Open strsql, cn, adOpenDynamic, adLockReadOnly
19. l.Clear
20. Do While Not rs.EOF '( here Rs.Eof is true even data is upto 2008 no )
21. l.AddItem rs.Fields(1).Value
22. rs.MoveNext
23. Loop
24. rs.Close
25. Else
26. l.Clear
27. End If
28. End

how can i use datagrideview insted of listbox and what is its code

Please Let Me Know the simple Code

Thanks
Thanks
Thanks




Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.