Click here to Skip to main content
15,908,634 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: Show Data in Hierarcal Structure in .net control with multiple textboxes associated with each node.. Pin
TC2827-Oct-06 18:03
TC2827-Oct-06 18:03 
QuestionHow to create setup for VB and crystal report appl [modified] Pin
Software_Guy_12326-Oct-06 18:33
Software_Guy_12326-Oct-06 18:33 
QuestionCircle Packing Pin
batusai_3rd26-Oct-06 17:52
batusai_3rd26-Oct-06 17:52 
AnswerRe: Circle Packing Pin
Dave Sexton26-Oct-06 22:38
Dave Sexton26-Oct-06 22:38 
Questionhelp combobox Pin
Evalee26-Oct-06 17:26
Evalee26-Oct-06 17:26 
AnswerRe: help combobox Pin
Dave Sexton26-Oct-06 22:41
Dave Sexton26-Oct-06 22:41 
GeneralRe: help combobox Pin
Evalee27-Oct-06 0:36
Evalee27-Oct-06 0:36 
AnswerRe: help combobox Pin
Janani Divya27-Oct-06 1:49
Janani Divya27-Oct-06 1:49 
Here is one way of binding data in combo box:

In code behind:

Dim ds As New DataSet
ds = class_Ratetype.ComboRateDisplay()
Dim dvs As New DataView(ds.Tables(0))
If dvs.Count > 0 Then
Me.ComboRoomType.DataSource = dvs
Me.ComboRoomType.DisplayMember = "Roomtype"
Me.ComboRoomType.ValueMember = "Roomtype_Id"

End If
End Sub


Class file content for this:

Public Function ComboRateDisplay() As DataSet
Dim constr As String = SqlHelper.GetConnectionString()
Dim conn As New SqlConnection(constr)
Dim cmdSQL As New SqlCommand("SP_COMBORATEDISPLAY", conn)
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim dv As New DataView
cmdSQL.CommandType = CommandType.StoredProcedure
conn.Open()
da.SelectCommand = cmdSQL
da.Fill(ds, "TBL_Roomtype")
ComboRateDisplay = ds.Copy
da.Dispose()
If (Not conn Is Nothing) Then
conn.Close()
conn.Dispose()
End If
GC.Collect()
End Function


For ur reference:

class_Ratetype ---> object for class file
ComboRoomType ----> combobox name
Roomtype ----> Display member
Roomtype_Id ----> Value member
SP_COMBORATEDISPLAY --> Stored procedure
TBL_Roomtype ----> Table name


Janani
AnswerRe: help combobox Pin
Kschuler27-Oct-06 10:04
Kschuler27-Oct-06 10:04 
Questionkeypress to include the back space Pin
thefludragon26-Oct-06 15:42
thefludragon26-Oct-06 15:42 
AnswerRe: keypress to include the back space Pin
Xint026-Oct-06 17:28
Xint026-Oct-06 17:28 
QuestionVB.Net 2003 and VB6 Pin
Mekong River26-Oct-06 15:12
Mekong River26-Oct-06 15:12 
AnswerRe: VB.Net 2003 and VB6 Pin
Kevin McFarlane27-Oct-06 3:52
Kevin McFarlane27-Oct-06 3:52 
QuestionVery Urgent!!! Deadline!!! Pin
UltraCoder26-Oct-06 12:43
UltraCoder26-Oct-06 12:43 
AnswerRe: Very Urgent!!! Deadline!!! Pin
Dave Kreskowiak27-Oct-06 5:48
mveDave Kreskowiak27-Oct-06 5:48 
AnswerRe: Very Urgent!!! Deadline!!! Pin
Dave Kreskowiak27-Oct-06 5:54
mveDave Kreskowiak27-Oct-06 5:54 
QuestionUnload Close Command Pin
UltraCoder26-Oct-06 11:27
UltraCoder26-Oct-06 11:27 
AnswerRe: Unload Close Command Pin
Dave Kreskowiak26-Oct-06 18:02
mveDave Kreskowiak26-Oct-06 18:02 
QuestionResolving Excel Open Processes after ADO Connection Pin
pao_e_vinho26-Oct-06 8:57
pao_e_vinho26-Oct-06 8:57 
QuestionVB 2005 Pin
Pete Newman26-Oct-06 8:52
Pete Newman26-Oct-06 8:52 
QuestionTextBox Property Pin
andy3826-Oct-06 7:38
andy3826-Oct-06 7:38 
AnswerRe: TextBox Property [modified] Pin
AlexeiXX326-Oct-06 8:21
AlexeiXX326-Oct-06 8:21 
AnswerRe: TextBox Property Pin
ADY00726-Oct-06 8:56
ADY00726-Oct-06 8:56 
GeneralRe: TextBox Property Pin
Dave Kreskowiak26-Oct-06 10:02
mveDave Kreskowiak26-Oct-06 10:02 
QuestionPrinting a Form Pin
dptalt26-Oct-06 7:00
dptalt26-Oct-06 7:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.