5 Replies - 496 Views - Last Post: 22 July 2014 - 09:14 AM Rate Topic: -----

#1 Boopathi.S  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-July 14

Retrive a Particular column from ms access to vb.net combobox

Posted 13 July 2014 - 01:07 AM

hai friends i am doing my mini project in vb.net with ms-access & i want to retrieve a particular column from table to combobox can any one help me for that :helpsmilie: ... and also i am new for vb.net so i need info for how to generate a report in vb.net when i click a single button is it possible :sarcasm: ....

Is This A Good Question/Topic? 0
  • +

Replies To: Retrive a Particular column from ms access to vb.net combobox

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9392
  • View blog
  • Posts: 35,273
  • Joined: 12-June 08

Re: Retrive a Particular column from ms access to vb.net combobox

Posted 13 July 2014 - 09:26 AM

I would recommend going to the tutorial section. Plenty of database interaction write ups there!
Was This Post Helpful? 0
  • +
  • -

#3 Boopathi.S  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-July 14

Re: Retrive a Particular column from ms access to vb.net combobox

Posted 22 July 2014 - 08:51 AM

hai friends i am doing my mini project .... i have 3 table namely course_details which have two fields course_id(pk) and course_name , second table is subject_details which have four fields sub_code(pk) , sem , sub and course_id(here its fk) and third table is student_details which have 3 fields namely reg_num(pk) , name and course_id(fk).... now what i need is in vb.net i have combobox 2 retrieve
these details but my problem is if i choose course_id in first combobox then remaining combobox should show only the related items ..... :helpsmilie: :helpsmilie: :helpsmilie: :helpsmilie:

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9392
  • View blog
  • Posts: 35,273
  • Joined: 12-June 08

Re: Retrive a Particular column from ms access to vb.net combobox

Posted 22 July 2014 - 08:54 AM

Okay.. where's your database connection code? SELECT statement? Check the tutorial section for write ups on database interaction.

Merging duplicate topics.
Was This Post Helpful? 0
  • +
  • -

#5 Boopathi.S  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 13-July 14

Re: Retrive a Particular column from ms access to vb.net combobox

Posted 22 July 2014 - 09:05 AM

View Postmodi123_1, on 22 July 2014 - 08:54 AM, said:

Okay.. where's your database connection code? SELECT statement? Check the tutorial section for write ups on database interaction.

Merging duplicate topics.


Actually this is my code but i am new for sql so i am not so much aware of queries can u please help me for that thanks in advance ....

Try
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Siva\Desktop\project\IMAS-DB\IMAS.mdb;")
Dim asql As String = ("SELECT * FROM Subject_Details where course_id = cmbCID.text And course_id like '%1%' or '%2%' or '%3%' ")
Dim da As New OleDbDataAdapter(asql, cn)
Dim ds As New DataSet
da.Fill(ds)
cmbSem.ValueMember = "sem"
cmbSem.DataSource = ds.Tables(0)
cmbSem.SelectedIndex = 0
cmbSC.ValueMember = "sub_code"
cmbSC.DataSource = ds.Tables(0)
cmbSC.SelectedIndex = 0
cmbSub.ValueMember = "sub"
cmbSub.DataSource = ds.Tables(0)
cmbSub.SelectedIndex = 0
Catch ex As Exception
MsgBox("ERROR : " & ex.Message.ToString)
End Try
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9392
  • View blog
  • Posts: 35,273
  • Joined: 12-June 08

Re: Retrive a Particular column from ms access to vb.net combobox

Posted 22 July 2014 - 09:14 AM

As I suggested - perhaps read through the tutorials and snippets.

Examples:

SQL Basics In VB.Net

OleDb Basics in VB.Net

A Really Simple Database Create a Database using Access & VB.net Express 2008

Snippet:
Basic SQL Adapter Setup

Basic SQL Command Setup
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1