By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

VB .net script task how to handle NULL values

P: 1
I really need help with this one. I am using a script task to write data pulled from a MS SQL DB to a fixed width file. The script takes the ItemArray and writes the value of the column to the file using a streamwriter. The problem is when any of the DB values are NULL it throws off the fixed width. I'm not sure if I should try to handle this in the queries. If so, how should I make sure that if the value is NULL ,an empty string of the correct width is passed? Or should I handle it in the VB script with something like 'If not dbnull' but I'm not sure how to get the length the field is supposed to be from the array item.. If I am able to get the length how can I use that to write spaces or x's in place of actual data. I am new to this so I am stumped. Any help is greatly appreciated!
May 15 '10 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
Checking for DBNull would be the first step.
I'm not sure how you would get the length of the field though....
May 19 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.