|
-
Jul 14th, 2009, 02:12 AM
#10
Thread Starter
Frenzied Member
Re: Database Coding
if i go for the combo box inspite of the grid then?
Each combo box for each column?
I did the below coding but i cant complete the coding........
just check it.........
Imports system.data
Imports System.Data.OleDb
Public Class Form1
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
con = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\Users\Gautam\Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\db3.mdb;")
con.Open()
cmd = New OleDbCommand("Select * from table1", con)
Dim da As New OleDbDataAdapter(cmd)
Dim dt As New DataTable
da.fill(dt)
con.Close()
ComboBox1.DataSource = dt
ComboBox2.DataSource = dt
ComboBox3.DataSource = dt
ComboBox4.DataSource = dt
ComboBox1.Items.Add("Name")
ComboBox2.Items.Add("Roll")
ComboBox3.Items.Add("Sex")
ComboBox4.Items.Add("Address")
ComboBox.databind()
Catch ex As Exception
End Try
End Sub
End Class
i cant code the selected portion properly........
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|