Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an executable
Message
From
12/08/2008 17:00:59
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01338423
Message ID:
01338436
Views:
21
Bob,

Can you search for ConnectionString in your whole project?

>OK. That makes sense but I have tried this and I am still getting an error and I believe it is because the database connection has not been established as I am getting an object null reference.
>
>Here is the error stack I am getting:
>
>
>   at OakLeaf.MM.Main.mmAppBase.get_DatabaseMgr()
>   at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey)
>   at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject()
>   at OakLeaf.MM.Main.Business.mmBusinessObject.CreateParameter(String name, Object value)
>   at Bpit.TradeMgmt.Business.ImportType.GetImportTypeByPK(Int32 importTypeID) in C:\MMApps\TradeMgmt\TradeMgmtBusiness\ImportType.cs:line 99
>   at Bpit.TradeMgmt.Business.LoadBankFile.ReadAndSaveBankFile(Int32 importTypeID) in C:\MMApps\TradeMgmt\TradeMgmtBusiness\LoadBankFile.cs:line 43
>   at Bpit.TradeMgmt.ImportAndProcessRidge.Program.Main(String[] args) in C:\MMApps\TradeMgmt\Console\ImportAndProcessRidge\Program.cs:line 19
>   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
>   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
>   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
>   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
>   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
>   at System.Threading.ThreadHelper.ThreadStart()
>
>
>I don't see how the console app uses the app.config file to establish connection to a database.
>
>
>
>>You can use/create an app.config for console applications (they're just not added to the project by default). Right-click on the project and select Add > New Item. Then select Application Configuration File. You probably can just take the default MM.NET config file it creates and cut and paste the entire thing into this new file. Or just copy the app.config from another MM.NET project into this project, and then add it instead.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform