473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

string filer

Hi , Please help me

I'm making a table with subtables

like this 001000 States
001001 Florida
001002 CAlifornia
001003 Virginia
002000 Tax %

What I need is show it in a listbox with a filter the three first
characters is the table id and the las three is the subtableID

I try to do it but I can't please anyone can show me the code for do it
thanks
joseluis
Jul 21 '05 #1
2 1199
Jose, could you tell me a little more about what you're trying to do? For
instance, with those values, what is it that you want to appear in the
Listbox for the user to see?
"JoseLuis" <jl*****@hotmail.com> wrote in message
news:ez**************@TK2MSFTNGP15.phx.gbl...
Hi , Please help me

I'm making a table with subtables

like this 001000 States
001001 Florida
001002 CAlifornia
001003 Virginia
002000 Tax %

What I need is show it in a listbox with a filter the three first
characters is the table id and the las three is the subtableID

I try to do it but I can't please anyone can show me the code for do it
thanks
joseluis

Jul 21 '05 #2
Jose,

This is not the exact answer, however maybe you can use it for your problem,
I made it some minutes ago for another question in the language.vb
newsgroup. For the sample with the states in a listbox and using that in an
object array are I thought thousands of samples on Internet.

When this sample beneath does not fit, remember than that you have to cast
the object in the selected arrayitem to datarowview to use it.

Cor

\\\needs a form with 2 listboxes and one textbox
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim countries() As String = {"US", "EU"}
ListBox1.Items.AddRange(countries)
Dim table As New DataTable("Sample")
CreateTable(table)
Dim dv As New DataView(table)
ListBox2.DataSource = dv
dv.Sort = "Name"
ListBox2.DisplayMember = "Name"
TextBox1.DataBindings.Add(New Binding("Text", dv, "Id"))
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles
ListBox1.SelectedIndexChanged
DirectCast(ListBox2.DataSource, DataView).RowFilter = _
"Country = '" & ListBox1.SelectedItem.ToString & "'"
End Sub
Private Sub CreateTable(ByVal Table As DataTable)
Table.Columns.Add("Id")
Table.Columns.Add("Name")
Table.Columns.Add("Country")
For i As Integer = 0 To 7
Dim dr As DataRow = Table.NewRow
dr(0) = i.ToString
Table.Rows.Add(dr)
Next
Table.Rows(0)(1) = "Herfried K. Wagner"
Table.Rows(1)(1) = "Armin Zingler"
Table.Rows(2)(1) = "Ken Tucker"
Table.Rows(3)(1) = "CJ Taylor"
Table.Rows(4)(1) = "Jay B Harlow"
Table.Rows(5)(1) = "Terry Burns"
Table.Rows(6)(1) = "Tom Shelton"
Table.Rows(7)(1) = "Cor Ligthert"
Table.Rows(0)(2) = "EU"
Table.Rows(1)(2) = "EU"
Table.Rows(2)(2) = "US"
Table.Rows(3)(2) = "US"
Table.Rows(4)(2) = "US"
Table.Rows(5)(2) = "EU"
Table.Rows(6)(2) = "US"
Table.Rows(7)(2) = "EU"
End Sub
///

I hope this helps?

Cor
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Krakatioison | last post by:
My sites navigation is like this: http://www.newsbackup.com/index.php?n=000000000040900000 , depending on the variable "n" (which is always a number), it will take me anywhere on the site......
5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: John F Dutcher | last post by:
I use code like the following to retrieve fields from a form: recd = recd.append(string.ljust(form.getfirst("lname",' '),15)) recd.append(string.ljust(form.getfirst("fname",' '),15)) etc.,...
9
by: Derek Hart | last post by:
I wish to execute code from a string. The string will have a function name, which will return a string: Dim a as string a = "MyFunctionName(param1, param2)" I have seen a ton of people...
10
by: Angus Leeming | last post by:
Hello, Could someone explain to me why the Standard conveners chose to typedef std::string rather than derive it from std::basic_string<char, ...>? The result of course is that it is...
37
by: Kevin C | last post by:
Quick Question: StringBuilder is obviously more efficient dealing with string concatenations than the old '+=' method... however, in dealing with relatively large string concatenations (ie,...
6
by: Jurgen Haan | last post by:
Hey all... Does anyone here have any experience with running DB2 on a NetApp filer (storage)? If so, what volumes did you use (how many disks per volume). For those who do not know what a Netapp...
2
by: JoseLuis | last post by:
Hi , Please help me I'm making a table with subtables like this 001000 States 001001 Florida 001002 CAlifornia 001003 Virginia 002000 Tax %
1
by: lltong | last post by:
Hi, Does anybody have any experience with DB2 on NetApp Filer using NFS? I am reading the documentation that it suggests to mount the data volumn to: : nfs hard,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.