|
well there you go, treeview is what you where looking for. But it might be messy to show relationships, I would look into a charting control.
|
|
|
|
|
Do you have any suggestions.
Humble Programmer
|
|
|
|
|
1[^]
2[^]
Best of luck in your search
|
|
|
|
|
Thank you very much for your time.
Humble Programmer
|
|
|
|
|
<pre>
Here is a function to populate any combobox with data from a table column.This style wld work for any database. I prefer to use oracle in this instance.
</pre>
<pre>
You first have to create the function in a module or class
and call it from anywhere in your project with the required parameters
</pre>
<code>
'For instance, drop a combobox(combobox1) and a button(button1) and under the button add
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
'when calling from a class
'className.populateAnyCombo(comboboxName,"sql statment", _
'column name, connection string)
'---call function from a module----
PopulateAnyCombo(combobox1,"SQL(eg Select Column_Name from Table_Name)", _
"column_name", connectionString)
End Sub
'----------Place in a module or class----------
Public Function PopulateAnyCombo(ByVal cBox As ComboBox, ByVal strSQL _
As String, ByVal tableColumn As String,ByVal connString As String ) As String()
Dim array(0) As String
Dim cnt As Integer = 0
Dim conn As New OracleConnection
conn.ConnectionString = connString
Try
conn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
MsgBox("Failed conection to Oracle" & ex.Message)
Return array
End Try
Dim cmd As New OracleCommand
With cmd
.CommandText = strSQL
.CommandType = CommandType.Text
.Connection = conn
End With
'data reader to store recordsets retrieved
Dim dr As OracleDataReader
'Reading an populating records in array
'ReDim preserve increases the array size and preserve old members
Try
dr = cmd.ExecuteReader
While dr.Read
ReDim Preserve array(cnt)
array(cnt) = dr.Item(tableColumn)
cnt = cnt + 1
End While
cBox.Items.Clear()
cBox.Items.AddRange(array)
Return array
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
Dim a(0) As String
a(0) = 0
Return a
Finally
conn.Close()
conn.Dispose()
End Try
End Function
'-----------------place in a module or class-------------
</code>
<pre>
Would be glad to know if i helped solve a problem
Criticisms to this snippet are welcomed
nan492001@yahoo.com
</pre>
|
|
|
|
|
Please learn how to format a message correctly. The <pre> tags are meant to enclose blocks of code (multiple lines of code) not message text. The <code> tags are meant to enclose small sections of code that are meant to be read in-line with the sentence.
This is how your message should look:
Here is a function to populate any combobox with data from a table column.This style wld work for any database. I prefer to use oracle in this instance.
You first have to create the function in a module or class
and call it from anywhere in your project with the required parameters
For instance, drop a combobox(combobox1) and a button(button1) and under the button add
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
'when calling from a class
'className.populateAnyCombo(comboboxName,"sql statment", _
'column name, connection string)
'---call function from a module----
PopulateAnyCombo(combobox1,"SQL(eg Select Column_Name from Table_Name)", _
"column_name", connectionString)
End Sub
'----------Place in a module or class----------
Public Function PopulateAnyCombo(ByVal cBox As ComboBox, ByVal strSQL _
As String, ByVal tableColumn As String,ByVal connString As String ) As String()
Dim array(0) As String
Dim cnt As Integer = 0
Dim conn As New OracleConnection
conn.ConnectionString = connString
Try
conn.Open()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
MsgBox("Failed conection to Oracle" & ex.Message)
Return array
End Try
Dim cmd As New OracleCommand
With cmd
.CommandText = strSQL
.CommandType = CommandType.Text
.Connection = conn
End With
'data reader to store recordsets retrieved
Dim dr As OracleDataReader
'Reading an populating records in array
'ReDim preserve increases the array size and preserve old members
Try
dr = cmd.ExecuteReader
While dr.Read
ReDim Preserve array(cnt)
array(cnt) = dr.Item(tableColumn)
cnt = cnt + 1
End While
cBox.Items.Clear()
cBox.Items.AddRange(array)
Return array
Catch ex As Exception
MessageBox.Show(ex.Message, "Error")
Dim a(0) As String
a(0) = 0
Return a
Finally
conn.Close()
conn.Dispose()
End Try
End Function
'-----------------place in a module or class------------- Would be glad to know if i helped solve a problem
Criticisms to this snippet are welcomed
nan492001@yahoo.com That being said, why is this a forum post? What is your question here?
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Personally, I don't have a lot of use for this code, however this is a VB forum. Do topics only have to be questions? The discussion is VB specific and isn't one of the common repeated questions topics.
I thought it was cool that nan49 attempted to post some utility code that he thought would be beneficial to other members (vs. creating a full blown guide\tutorial) - although the formatting was hosed.
My .02S
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
Strictly speaking, no topics don't have to only be questions although I think that is the majority. I think it is much preferred to publish an article for something like this and provide more background into what problem is being solved and why and explanations of how the code works, although this probably doesn't have enough "meat" to be an article. There was talk a while back of a new "article type" for posting code snippets (similar to this) but I don't know what happened with it.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Scott Dorman wrote: Strictly speaking, no topics don't have to only be questions although I think that is the majority. I think it is much preferred to publish an article for something like this and provide more background into what problem is being solved and why and explanations of how the code works, although this probably doesn't have enough "meat" to be an article. There was talk a while back of a new "article type" for posting code snippets (similar to this) but I don't know what happened with it.
I get what you're saying, that most people probably prefer to read articles vs. snippets and/or code segments. For me, it just depends on the difficultly and past experience with the specified topic. But I think there is valuable use with snippets and smaller code samples. Most of the time readers can understand the snippet code (esp. with periodic comment lines) without the need for a full blown article; esp. on topics that the reader is familiar with.
It would be a nice change of pace, other than seeing the endless questions (esp the same ones asked almost daily/weekly). Don't get me wrong...... I'd still check the forum frequently. It's nice to gain knowledge and ideas through questions and answers posted by members of varying skill levels.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
He did; but it looks like it's going to get rejeted. Guess he wanted a back-up plan.
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
Yes, I see that now...for similar reasons why the forum post is being down voted as well.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Here is a function to populate any combobox with data from a table column.This style wld work for any database. I prefer to use oracle in this instance.
You first have to create the function in a module or class
and call it from anywhere in your project with the required parameters
<br />
<br />
'For instance, drop a combobox(combobox1) and a button(button1) and under the button add<br />
<br />
Private Sub Button1_Click(ByVal sender As System.Object, _<br />
ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
'when calling from a class <br />
'className.populateAnyCombo(comboboxName,"sql statment", _ <br />
'column name, connection string)<br />
<br />
'---call function from a module----<br />
<br />
PopulateAnyCombo(combobox1,"SQL(eg Select Column_Name from Table_Name)", _<br />
"column_name", connectionString)<br />
<br />
End Sub<br />
<br />
<br />
<br />
<br />
<br />
'----------Place in a module or class----------<br />
<br />
Public Function PopulateAnyCombo(ByVal cBox As ComboBox, ByVal strSQL _<br />
As String, ByVal tableColumn As String,ByVal connString As String ) As String()<br />
<br />
Dim array(0) As String<br />
Dim cnt As Integer = 0<br />
Dim conn As New OracleConnection<br />
<br />
conn.ConnectionString = connString<br />
Try<br />
conn.Open()<br />
Catch ex As Exception<br />
MsgBox("Failed conection to Oracle" & ex.Message)<br />
Return array<br />
End Try<br />
<br />
Dim cmd As New OracleCommand<br />
With cmd<br />
.CommandText = strSQL<br />
.CommandType = CommandType.Text<br />
.Connection = conn<br />
End With<br />
'data reader to store recordsets retrieved<br />
Dim dr As OracleDataReader<br />
<br />
'Reading an populating records in array<br />
'ReDim preserve increases the array size and preserve old members<br />
Try<br />
dr = cmd.ExecuteReader<br />
While dr.Read<br />
ReDim Preserve array(cnt)<br />
array(cnt) = dr.Item(tableColumn)<br />
cnt = cnt + 1<br />
End While<br />
<br />
cBox.Items.Clear()<br />
cBox.Items.AddRange(array)<br />
<br />
Return array<br />
Catch ex As Exception<br />
<br />
Dim a(0) As String<br />
a(0) = 0<br />
Return a<br />
Finally<br />
conn.Close()<br />
conn.Dispose()<br />
End Try<br />
End Function<br />
<br />
'-----------------place in a module or class-------------<br />
<br />
Would be glad to know if i helped solve a problem
Criticisms to this snippet are welcomed
nan492001@yahoo.com
|
|
|
|
|
What is this?
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
He's trying to promote his article that is getting rejected.
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
Everytime I change something in the dropdown list, the page doesn't change, it just stays the same, What problems could I have.
|
|
|
|
|
This sounds like it's an asp.net related question, so it should probably be asked in that forum[^]. No matter what, you need to provide more explanation of what you are trying to accomplish, what your code looks like, etc. This isn't really enough information for someone to try and help.
Simple questions first:
1. What event are you listening for? (From the title it sounds like the SelectedIndexChanged event.)
2. Do you have the handler wired correctly? (Can you set a break point in the event handler and see that it gets hit?)
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
well this my code behind
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
'Dim ds As DataTable
'ds = GridView1.DataSource
'GridView1.DataSource = ds
PopulateGrid(Convert.ToDateTime(DropDownList1.SelectedValue.ToString()))
|
|
|
|
|
This message has been "moved[^]" to the ASP.NET forum.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Hello
I am using on-demand subreport in crystal report for the first time. Please help me on following problems.
1)I dont know exactly on which event to set datasource for on-demand subreport & how to set datasource for on-demand subreport.
2)How to get main report value against which I want to load subreport.
Regards
Ali Raza
|
|
|
|
|
Hai,
I did socket server application using VB.NET, it will receive every minutes 100000 of data for my IP it contains around forty coma separated values. Once if receive the data i need to store in sql Server, wats the best way to handle this kind of situation for the best better performance.
|
|
|
|
|
srisant wrote: wats the best way to handle this kind of situation for the best better performance.
Use asynchronous fashioned methods. Separate the socket data receive and processing into multiple threads so that none of them will be blocked.
|
|
|
|
|
Adding to what has been said, you can use ThreadPool to take care of this.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Well, Asynchronous methods uses a thread pool thread internally.
|
|
|
|
|
Hi,
I want to integrate vb in the mainframe environment. As in some mainframe emulators gui feauters like mouse scroll up and down are restricted. can you please help me how to do this through vb
|
|
|
|
|
Its doubtful that you will get a vb.net app to run on a mainframe as it will require the .net runtime.
ushaallwyn wrote: mouse scroll up and down are restricted. can you please help me how to do this through vb
If this typical of your level of experience I suggest you start with something easier than a mainframe emulator.
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|