472,337 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

ADO.net: 3 Data Set Questions (Issues)

I'm updating my current VB.et application. I currently reads about 6 tables
from an MS Data base. I've created a new MDB file which combines the 6 tables
into 1 table. I'm doing this because I know I'll speed up my application
loading time by more than 10 seconds (out of about 20).

I've run across three situations in which I'm stuck at:

Issue One:

If my largest Column has (say) 200 lines, other columns will have less data
lines. So say Column 1 has 50 lines of data, column 2 has 200 lines and
column 3 has 150 lines. Then column 1 and 3 will have lines containing
nothing (ie null or blank lines).

How to I test for a 'null' in a FOR statement? This is so that I can tell
when I've hit the end of my data for that column?
Issue Two:

For the above, How can I get rid of any blank lines when I bind the Datasource
to a ComboBox pull down? Column 3 will have 50 lines of blank. So if I sort
a ComboBox, the first 50 lines are blank! :(
Issue Three:

I've several ComboBox pulldowns which are bind to the same data set. But if I
change one, then the all change! How can I control them independantly?

For example, if I have 6 ComboBoxes. They are all bound to the same Data
Source, but each one is bound to a different Member of that Data Source.

So say I want to have 1 and 2 related (one changes, so does the other)... then
3 and 4 paired together similar as 1 and 2, and 5 and 6 completely independant
from all the others?

Mucho Appreciated!

Bruce
Jul 21 '05 #1
8 1619
IsDbNull and use a DataView for each combo

"Mr. B" <Us**@NoWhere.com> wrote in message
news:ru********************************@4ax.com...
I'm updating my current VB.et application. I currently reads about 6 tables from an MS Data base. I've created a new MDB file which combines the 6 tables into 1 table. I'm doing this because I know I'll speed up my application
loading time by more than 10 seconds (out of about 20).

I've run across three situations in which I'm stuck at:

Issue One:

If my largest Column has (say) 200 lines, other columns will have less data lines. So say Column 1 has 50 lines of data, column 2 has 200 lines and
column 3 has 150 lines. Then column 1 and 3 will have lines containing
nothing (ie null or blank lines).

How to I test for a 'null' in a FOR statement? This is so that I can tell
when I've hit the end of my data for that column?
Issue Two:

For the above, How can I get rid of any blank lines when I bind the Datasource to a ComboBox pull down? Column 3 will have 50 lines of blank. So if I sort a ComboBox, the first 50 lines are blank! :(
Issue Three:

I've several ComboBox pulldowns which are bind to the same data set. But if I change one, then the all change! How can I control them independantly?

For example, if I have 6 ComboBoxes. They are all bound to the same Data
Source, but each one is bound to a different Member of that Data Source.

So say I want to have 1 and 2 related (one changes, so does the other)... then 3 and 4 paired together similar as 1 and 2, and 5 and 6 completely independant from all the others?

Mucho Appreciated!

Bruce

Jul 21 '05 #2
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
IsDbNull and use a DataView for each combo


Excellent... I got the DataView working fine! Just have to work more on the
IsDbNull part. But thanks for pointing me in the right direction!

Regards,

Bruce
Jul 21 '05 #3
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
IsDbNull and use a DataView for each combo
Well... that solved all but Issue Two:
Issue Two:

For the above, How can I get rid of any blank lines when I bind the
Datasource to a ComboBox pull down? Column 3 will have 50 lines of blank. So if I
sort a ComboBox, the first 50 lines are blank! :(


Jul 21 '05 #4
If you are binding to a datasource that has the blanks within, the easiest
way is to prevent the blanks from populating when you initially pull the
data. A lot of different ways of writing your query to do that, but
basically do not return the null cells. If you are using a stored procedure,
one way is to write subqueries for each field to filter out the nulls/empty
cells.

"Mr. B" <Us**@NoWhere.com> wrote in message
news:16********************************@4ax.com...
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
IsDbNull and use a DataView for each combo


Well... that solved all but Issue Two:
Issue Two:

For the above, How can I get rid of any blank lines when I bind the
Datasource to a ComboBox pull down? Column 3 will have 50 lines of blank. So if Isort a ComboBox, the first 50 lines are blank! :(

Jul 21 '05 #5
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
If you are binding to a datasource that has the blanks within, the easiest
way is to prevent the blanks from populating when you initially pull the
data. A lot of different ways of writing your query to do that, but
basically do not return the null cells. If you are using a stored procedure,
one way is to write subqueries for each field to filter out the nulls/empty
cells.


hmm... not 100% I'm sure what you mean... but I'll try playing with Filters
and see where I go/get. I don't recall seeing anything on this in my books...
but I'll look.

Thanks (again)!

Bruce
Jul 21 '05 #6
The datasource contains the "blanks" (empty string). The easiest way to deal
with that is to prevent it at the time you read in the data from the
database. Alternatively, you have to filter that out of your dataview. Take
a look at this post:

http://groups.google.com/groups?hl=e...amework.adonet

"Mr. B" <Us**@NoWhere.com> wrote in message
news:kv********************************@4ax.com...
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
If you are binding to a datasource that has the blanks within, the easiestway is to prevent the blanks from populating when you initially pull the
data. A lot of different ways of writing your query to do that, but
basically do not return the null cells. If you are using a stored procedure,one way is to write subqueries for each field to filter out the nulls/emptycells.
hmm... not 100% I'm sure what you mean... but I'll try playing with

Filters and see where I go/get. I don't recall seeing anything on this in my books... but I'll look.

Thanks (again)!

Bruce

Jul 21 '05 #7
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
The datasource contains the "blanks" (empty string). The easiest way to deal
with that is to prevent it at the time you read in the data from the
database. Alternatively, you have to filter that out of your dataview. Take
a look at this post:

http://groups.google.com/groups?hl=e...amework.adonet


Easier said than done (:

I looked at your example from above... but I dont' see how I can apply it :(

I've spent the last many hours searching the web on filtering... but they all
give great fitering information... except how to get Rid of Null values :(

One that looked promising was:

If you want to filter rows with null values, you must first convert the null
values to something such as a string:

dv.RowFilter = "Isnull(Col1,'Null') = 'Null'"

But that too didn't do too much... oh well.. might as well fall back and throw
the info into a Listbox, delete the blanks and then fire the info to my
Comboboxes... A crappy way to do it, but at least I know how to do that.

This just seems way over my head (which is hurting now) (:

Thanks anyways...

Bruce
Jul 21 '05 #8
With Deft Fingers, "Earl" <br******@newsgroups.nospam> wrote:
The datasource contains the "blanks" (empty string). The easiest way to deal
with that is to prevent it at the time you read in the data from the
database. Alternatively, you have to filter that out of your dataview. Take
a look at this post:


Well... I think I got it...

I found this posting:

http://www.akadia.com/services/dotnet_filter_sort.html

It said: To return only those columns with null values, use the following
expression:

"Isnull(Col1,'Null Column') = 'Null Column'"

.... So I just turned the Equal sign to Inequal (<>)... and it looks like it
solved my problem!

All the references to NULL's are no longer there in my pulldows! Just the
hard data!!!

My full code for one combo (cmbUserID) is as follows (where 'Employee' is the
column in the Table TSUpdate):

Dim usr1 As DataView = New DataView(DsTSUpdate.Tables("TSUpdate"))
usr1.RowFilter = "Isnull(Employee,'Null Column') <> 'Null Column'"
cmbUserID.DataSource = usr1
cmbUserID.DisplayMember = "Employee"
Regards,

Bruce
Jul 21 '05 #9

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

Similar topics

3
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of...
1
by: Thomas Holmgren | last post by:
Hi all I've tried to get my hands on the End User License Agreement for MS Visual C# .NET 2003 STANDARD edition, sofar without luck. Does...
7
by: jsale | last post by:
I have made an ASP.NET web application that connects to SQL Server, reading and writing data using classes. I was recommended to use session objects...
22
by: Deano | last post by:
Hi, I have a finished Microsoft Access app that we are distributing using an Access runtime. This works fine (mostly) but I'm sold on the...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network...
11
by: jason | last post by:
we have developed a .NET class library that defines a family of reusable business objects. the class library is developed in C#, and works quite...
4
by: Dean Craig | last post by:
I'm getting ready to build my first ASP.NET/SQL Server website that will be hosted on some web host out there (long distance, different network). ...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site...
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.