Avatar of DCampbell2006
DCampbell2006
 asked on

System.NullReferenceException

Hello Community -- I have a .NET 2003 app that I converted to .NET 2005. I'm receiving an error message "System.NullReferenceException" when I complie. Here's the code -- Thank you in advance.

private DataTable GetWeekDays(){
 string query = "SELECT * from dbo.fnGetWeekDay('" + selection.ToShortDateString() + "') order by Seq";

DataSet ds = SqlHelper.ExecuteDataset(Application["DBConn"].ToString(), CommandType.Text, query);
return ds.Tables[0];
            }//GetWeekDays()
.NET Programming

Avatar of undefined
Last Comment
DCampbell2006

8/22/2022 - Mon
SOLUTION
gdupadhyay

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
gdupadhyay

For DB connection, why you are not using web.config to store the connection string.
Please read this article for more information about the web.config
http://msdn.microsoft.com/en-us/library/ms178411.aspx
Let me know if you have any question.

Thanks
Ganesh
SOLUTION
Joel Coehoorn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
SwatiBhaskar

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
DCampbell2006

ASKER
used a copy of Microsoft.ApplicationBlocks.Data.dll from a coworker and app works fine. Thank you all....
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23