English 中文(简体)
LINQ-SQL中的变化链接
原标题:Change Connection string in LINQ-SQL

我利用VB开发了一个窗口形式应用程序。 使用LINQ-SQL的数据接入层净额 我想让数据库从申请中配置。 我已经建立了一个投入表,并在XML文件中节省了投入细节。

我需要知道如何配置LINQ,以开始使用新的组合式数据库。 我在座右边之一读过有关动态分配连接的内容,与以下解决办法挂钩,将数据环境瞬息万变的每个档案都包括在内。

MyDataClassesDataContext db = new MyDataClassesDataContext(dynamicConnString);


protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e)
{
    e.ObjectInstance = new MyDataClassesDataContext (dynamicConnString);
}

这一工作是否适合我的设想? 联系方式需要什么,如何包括数据库服务器的密码和地点?

还有一个问题。 我认为,林研中心在数据库被毁时,负责节省资源。 因此,我无需担心在申请完全存在时释放资源(使用<条码>申请书>。 如果情况确实如此,也只想确认。

事先得到任何帮助。

最佳回答

The connection string needs to be in the correct format for ADO.Net. If you have doubts, see this link for examples.

问题回答

暂无回答




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签