如何将本地数据库连接到ADO.NET C#? [英] How to connect local DB to ADO.NET C#?
本文介绍了如何将本地数据库连接到ADO.NET C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好。我用一些表创建了本地DB DBSimple.sdf。然后我发布了代码:
Hello. I created local DB DBSimple.sdf with some tables. Then i published code:
private string CommandText = "SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers";
private string ConnectionString = "";
SqlDataAdapter dataAdapter = new SqlDataAdapter(CommandText, ConnectionString);
对于本地文件DBSimple.sdf,ConnectionString必须是什么? (它数据库显示在Data Connections / Server Eplorer)
What is ConnectionString must be for local file DBSimple.sdf? (It Database showes at Data Connections/Server Eplorer)
推荐答案
我建议你从这里开始:ADO.NET概述 [ ^ ]。请阅读所有相关文章。
I would suggest you to start here: ADO.NET Overview[^]. Please, read all related articles.
这篇关于如何将本地数据库连接到ADO.NET C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文