.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

LINQ data source control and db connection string

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

I have designed a few pages which use LINQ datasources and Gridviews to maintain data.

I have built a data layer which happily uses System.Web.Configuration.WebConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString

However, the LINQ data source controls use Settings.designer.vb MySettings class definition which is auto generated and doesn't except the above Connection string.

Any ideas?

View Complete Post

More Related Resource Links

SSIS as data source in SSRS connection string


I have a connection string

="/f c:\test\test2\test2\package.dtsx /set \package.variables[User::varfil].Value;" & Parameters!varempid.Value

but its not returning any results. I need a valid connection string.

SSAS Deployment Wizard - Data Source connection string userid and Password getting removed



I have an SSAS database (Analysis Services 2005) which connects to Oracle for the data. I have the userid and password
saved in the connection string.


If I deploy the cube from Visual Studio I DON't have to manually edit the Data Source in the server to input the userid and password. The information is retained.


If I do a build and then deploy .asdatabase file using Deployment Wizard (Microsoft.AnalysisServices.Deployment.exe), the connection information dissappears. I have "Remove Passwords" = False in Project configuration. So when you build the project there will be a file with extension .assecurityinformation which holds the encrypted security info. Somehow

deployment wizard doesn't look at this file.


After the build I execute this command

Microsoft.AnalysisServices.Deployment.exe  .\Project.asdatabase /s:.\Deployment.log

I tried interactively and silent mode. Either way I cannot deploy the project with the userid and password in it.

Any clue?

Connection String issue: Keyword not supported: 'data source'.


I have three connection strings for my web application (ASP.Net) as MVC2 provides by default.

Bar the locations and the names, the syntax is identical, but in the second connection string, it keeps returning "Keyword not supported: 'data source'." EVEN THOUGH IT'S IDENTICAL. D:

Please help! I've tried changing the Syntax to include a "Metadata" tag, still didn't work!

Configurable connection string/data source for CE 4.0


I'm using CE 4.0 in a Silverlight app and my connection string  is:

Data Source=C:\MyApp\MyApp.Web\App_Data\MyAppDB.sdf;Password=***********;Persist Security Info=True

I don't want a hard coded file path in the connection string. Is it possible to make this configurable, or determine directory its located in at runtime?

abstract away the source of the connection string using a class with a static property.

ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Let's abstract away the source of the connection string using a class with a static property.

Errors in the high-level relational engine. A connection could not be made to the data source with t

When I deploy the cube which is sitting on my PC (local) the following 4 errors come up: Error 1 The datasource , 'AdventureWorksDW', contains an ImpersonationMode that that is not supported for processing operations.  0 0 Error 2 Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of 'Adventure Works DW', Name of 'AdventureWorksDW'.  0 0 Error 3 Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of 'Customer', Name of 'Customer' was being processed.  0 0 Error 4 Errors in the OLAP storage engine: An error occurred while the 'Customer Alternate Key' attribute of the 'Customer' dimension from the 'Analysis Services Tutorial' database was being processed.  0 0

Change connection string of Linq to Sql entities

Hi all.I have a solution which uses Linq to SQL Data Classes to acced the db. I have a project for my domain objects in my solution, which is a class library and has the dbml file. When I set up the dmbl using the wizard, Visual Studio created an app.config file on that project with the connection string. It also creatting a settings file with the same info. I've noticed that if I change the connection string in the settings file, the app.config gets updated, which is the expected behaviour.However, I'm having a problem when I deploy my web site to the production server. I already set the app.config file's Build Action to "Content", and also set Copy to ouput directory to "Always". Nevertheless, when I install the web site and change the connection string in the app.config file, it still takes the old connection string, so obviously I get an error. I've found that it only works if I change it with in Visual Studio and then compile, but of course that's not an optimal solution, because any change in the production db server would mean I have to change my project's assembly, thus generating a new version.Any thing I'm missing? What do I have to configure so that the assembly takes the connection string form my app.config file directly after I deploy?Thanks a lot.

Cannot create a connection to data source !!!! SSRS 2005

I cannot get this error resolve either for myself or any users, and I'm actually part of the Admin group!  Furthermore, a user with whom I'm tring allow to view this report keeps getting prompted for their windows username and password.  I thought that since this datasource was set to Windows Authentification that it would just pass it through? I'm pulling my hair out at this point: Screen Shots: http://www.webfound.net/datasource_connection.jpg http://www.webfound.net/datasource_connection2.jpg http://www.webfound.net/datasource_connection3.jpg Also As far as I know, I've given sufficient permissions to the right logins and right users on my SQL Databases and related stored procs that the datasets (not datasource) run An error has occurred during report processing. Cannot create a connection to data source 'datasourcename'. For more information about this error navigate to the report server on the local server machine, or enable remote errors

REST Connection Data Source is getting overriddeen by SPD 2010

Hi, I used a Linked Datasource consist of two REST Connection Data Source with the credentials saving with the data source. The first time i add the Data View to the Web Part Zone everything is fine and the data is shown fine but the moment i save it and close the aspx page and open it again, SPD overrides and adds some of the attributes in the DataSources tag, which makes it giving an error saying connection problem and if i copy paste the original Datasource tag with the values it works fine. Any Idea guy's i am just fighting with this from 2 days. Thanks Girish

Urgent How to Create it ,Object Data Source ,Linq and sql or other any way


my query is



my data is

HR    HR    Rec    Records    Leave    Leave Records    HRL.0001    Policy and Process for leave record.    27.06.2010    30.06.2010    WIP    Edlink
HR    HR    Rec    Records    Leave    Leave Records    HRL.0002    Quarterly Review    01.07.2010    04.07.2010    Planned    Edlink
HR    HR    DB    Database    SAL    Salary    DDS.0001    Calculation of Monthly salary    08.08.2010    09.08.2010    WIP    Edlink
HR    HR    Rec    Records    Ind    Induction Records    HRI.0001    Completion of dossiers.    08.07.2010    10.07.2010  

Data Source Connection Help


Hi Guys,


After the report deployment to http://XX-sql01/Reports/Pages/Report.aspx. When I click on report I am getting following error message. I checked all the data source connections and password everything seems to be ok.

Can anyone shed some light please.

  • The current action cannot be completed. The user data source credentials do not meet the requirements to run this report. Either the user data source credentials are not stored in the report server database, or the user data source is configured not to require credentials but the unattended execution account is not specified. (rsInvalidDataSourceCredentialSetting)


Binding a DVDropDown control to a XML data source


I'm having a heck of time figuring how to get my DVDropDown control to display items from the SoapDataSource (SOAP web service) or XmlDataSource (REST).


If I create a data view for the same data sources, I can see the data just fine, but when I go to Data Fields dialog, I can select the data source in the dropdown but in all cases, the two other dropdown to pick the value and display text are blank and there's nothing for me to select though I know there should be columns available for selection.


I've also tried manually coding those parameters, accounting for the possibility that I may need fully qualified XPath to get to the column itself but that causes an error.


What could I be missing?



Unable to drag data source to control to bind


I have a simple test application following the directions from http://msdn.microsoft.com/en-us/library/dd465159.aspx .  When I attempt to drag the data source onto the design surface I get the following error:

Cannot add the control to the design surface or bind to the control because the type TestApp.AdventureWorksEntities cannot be resolved.  Please try to build the project or add necessary assembly references.

The project as been built and the data source is in the same namespace.  I did a search for this error and the only hit I found was here, and mentioned Tools->Options->Extension Manager, 'Load per use extensions...'.  This option is checked.  I've tried unchecking and restarted with the same behavior.

Any ideas?


The data source control failed to execute the insert command


Hi All,

I have create table in SQL 2005 and retrive its data in to sharepoint  with the help of Database connection option through Sharepoint Designer. When configuring the connection i have selected a custom quer with stored procedure option and from the dropdown option selected the insert stored procedure everything is ok.

Stored Procedure
CREATE PROCEDURE ChangeTable_insert

 @PROJECT varchar(50) ,

INSERT INTO [dbo].[ChangeTable]





i have created new aspx page in Sharepoint Designer from the datasource details-->Insert selected fields as-->selected new item form and saved this page.
When i opened this page in to browser and try to save data it gives an below error
Go back to site 
Error: "The data source control failed to execute the insert command.
 Troubleshoot issues with Windows SharePoint Services."

please help me. i have to save data to sql database through sharepoint

thanks in advance

Cannot create a connection to data source ''


I copied an old report and changed the data sources. The report works fine in the designer and on the report server. But when I run it from the server on which the database is located it gives me the following error. Works fine when I use 'Store credentials in report server'. tried anonymous login too. Doesnt work.

  • An error has occurred during report processing.
    • Cannot create a connection to data source '<name of my datasource>'.
      • For more information about this error navigate to the report server on the local server machine, or enable remote errors
      • Please help.     &nb

Is a Dynamic Config Possible for SSAS BIDS Projects? (Data Source / Connection, and Deployment Targe


How do we automate SSAS Project configs such that (a) RDBMS data source server (connection) and (b) SSAS deployment target server are dynamic? 

As it stands, just before I script the ASDB (for deployment/promotion from Dev to QA, or QA to Prod, for example), I use BIDS designer interfaces to change the source connection and deployment targets, then script the ASDB. 

Is there a more dyamic alternative?  Perhaps something analogous to SSIS package configurations?  I can't believe that everybody is doing this as manually as I've done.

Change Dynamic Data database connection string


I have recently started to learn Dynamic Data Web application.

I have built a Dynamic data Website with LINQ data access layer. When the LINQ data context was built over an existing SQL2005 database, the connection string for that database was correctly, automatically, placed into the Settings and .edmx Code for the project. It works, but it's a "static" connection string.

I would like to be able to use this one LINQ data access layer against both test and production databases without having to manually change and recompile the project's connection string each time.

Is there a way to pass/change the User connection string to the LINQ data access layer at Run Time so that destination database changes? Ot in Other words How can user can choose a database from a list of databases.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend