connection-string

Socket Exception when connecting to Analysis Services Locally

I keep getting this error when trying to connect to an Analysis Services on the same machine the service is running on. If I connect via my desktop I don't see this error. I did quite a bit of googling, haven't found any solutions yet. When connecting from my desktop I am authenticated over a VPN. I get the feeling this error has somet...

List available DB providers

I have some problems with building connection strings. I used to generate "Provider=SQLOLEDB" or "Provider=SQLNCLI". Now I see that some users have SQLNCLI10 while SQLNCLI is missing. Is it possible to enumerate available providers so I could pick a valid one? System.Data.Common.DbProviderFactories.GetFactoryClasses() lists .NET data pr...

Securing database credentials and connection in ClickOnce publish

Hello! I have connection string with sensitive information (user,password) in Application.config.xml file. Now i need to publish this application through ClickOnce. Is there a way to encrypt connection string? On other hand can this be inplemented in database? For example: user connects with access only to fuction that checks username...

How to fix “The ConnectionString property has not been initialized” in nopCommerce

Hi Guys, I'm trying to integrate nopCommerce into a third party system but am hitting a problem when I try to access any nopCommerce pages. Because I'm integrating with a third party system I've had to merge web.configs and copy all files over. I have a standalone install of nopCommerce aswell and that is running fine. Any help would b...

Read an excel uploaded through FileUpload

I have an ASP.NET web application that has a fileupload control to allow users to upload an excel file for it to read. I'm using an OleDBConnection and I feel like my connection string or querystring is wrong since the app keeps throwing OleDBExceptions at me (ouch!). What would be a good way to save or access the uploaded files? Here...

Exception Details: System.ArgumentException: Illegal characters in path. ASP.NET MVC

Hi, I have a problem using ASP MVC with C#. When I create an aspx page with a strongly typed inherit I received the following error: Server Error in '/' Application. Illegal characters in path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more informatio...

ASP.net Beginner question: How to get rid of this error ?

Trying to create a simple login page in Asp.net C# but getting some error... I googled about the error... Tried all the solutions but to no avail... What am I doing wrong? The error is: "A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible...

Will my SQL Connection remain open after my dictionary is populated

In the code sample below, will my data context connection stay open once the ListOfLists method is completed? Do I need to explicitly close it, or will it stay open and be available for other methods. public static Dictionary<int, string > ListOfLists() { try { ListDataDataContext db = ne...

How long should the connectionString timeout be in ASP.NET applications? (sqlclient)

In my ASP.NET application, I have a sqlclient connectionstring in my web.config file, What is the recommended timeout setting for production environment? Default is 15 seconds. My web farm and database cluster are on the same switch, so there should not be much latency. ...

How does ServiceConfiguration.cscfg and ServiceDefinition.csdef play with WebConfig in Azure?

Hi, I have a big Silverlight app which I have successfully converted and added a CloudService project. I have uploaded the database to SQL Azure, and from my webconfig file with a connection to this database on SQL Azure everything works fine. So, my next step, where I'm crashing, was when adding a Cloud Service to my solution and setti...

How can I access SQLite with C#?

Hi everybody, I'm trying to get connected to my Sqlite database programmatically using C#/ASP.NET: string requete_sql = "SELECT * FROM USERS"; connStr = @"Data Source=C:\LocalFolder\FooBar.db;"; using (System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connStr)) { System.Data.SqlClient.SqlCommand cmd = n...

access - properly hosting backend of access database

i would like to host an access backend database on my computer and allow remote connections. every client will have their own access front end. is this a common practice? what would the connection string look like? ip address/localhost ?? would it be better to have a mysql backend? i need it over the internet? ...

Crystal Report 8.5 + SQL Server 2008 - connection bug

I have issues with connection in application that uses Crystal Report. Issue occurs when CR component initializes connection to database. Application crashes at that point. But when I initialize connection to some directory on server via remote desktop before application starts, then it connects to database successfully. In our projec...

Connection string for .DBF file don't work on IIS

I am using this connection string to query some .DBF Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=c:\Dbfs; But if i run the application on IIS (7.5) the connection cannot be opened and i get this OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified ...

Use connection string from different project when using Entity Model

I have a application that uses Entity Framework. I have added some custom tables to the application's db and want to map those tables in a different project using EF model and the POCO entity generator template. My separate project needs to be reusable so I will not know the username/password for the connectionstring. How can I use th...

Problem connecting to Remote MySQL with C#

i'm using Visual Studio 2010 and when i bind a DataGridView with my remote mysql db it works fine. but when i take the connection string from the wizard and try to use it with code i get: "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server" this is the connection string i try (i tried many variants):...

connect vb 2008 with sql server 2005 locally

Hi,I'm trying to connect vb 2008 with sql server 2005 locally. I have the database at the same laptop but I always get an error. Here's my code: Dim strconn As String strconn = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Database;Data Source=(local)" Try Dim connection As New SqlClient.SqlConnection(str...

How to give dynamic DataSource name in App.config

I am reading excel file and for that I do have connection string in App.config but I want to read each day the excel which is today's excel.. Each excel name is today's date(MM/dd/yy), so datasource name is somewhat dynamic. how to write the connection string in App.Config then I want to use something like <add name="Excels" connectio...

connection string with no user name and password, asp.net

i have a website built in asp.net connecting to a sql 2000 db. within my web.config file, i have a connection string referencing a DSN. in order for my db connection to work i have to include the username and password within the string. for security reasons, is there any way to connect to my db without displaying the username and passwo...

Change connection string in wpf application

Hi, I try to change connection string, but it is only change in memory, but not in App.Config file, below is the code I am using System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.ConnectionStrings.ConnectionStrings[1].ConnectionString = "metadata=res://*/TCSModel.c...