关于数据库的一个小问题

lzlblblz 2003-05-23 05:40:07
string myConnectionString = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=BookingSystem;" +
"Integrated Security=SSPI;";

OleDbConnection myConnection = new OleDbConnection(myConnectionString);
string myInsertQuery = "INSERT INTO PASSENGER Values('111', 'Northwind','男','jkjkjk','2003-05-20','lll')";
OleDbCommand myCommand = new OleDbCommand(myInsertQuery);
myCommand.Connection = myConnection;
myConnection.Open();
myCommand.ExecuteNonQuery();
myCommand.Connection.Close();

其中的
"Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=BookingSystem;" +
"Integrated Security=SSPI;";

这些东西是什么意思啊?如何设置呢?
...全文
48 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzlblblz 2003-05-24
  • 打赏
  • 举报
回复
UDL文件生成?能不能具体讲讲?谢谢
pythonpowered 2003-05-23
  • 打赏
  • 举报
回复
学习!
CO2003 2003-05-23
  • 打赏
  • 举报
回复
Provider : 提供数据库驱动程序
Initial Catalog : 数据库名
Integrated Security :可以理解为安全认证
jcaomao 2003-05-23
  • 打赏
  • 举报
回复
Initial Catalog是 数据库的当前库名
Security 安全
goingway 2003-05-23
  • 打赏
  • 举报
回复
你可以用UDL文件生成,然后把里面那连接串拿过来就是.........
lzlblblz 2003-05-23
  • 打赏
  • 举报
回复
我是说Provider ,Initial Catalog,Integrated Security分别表示的具体意义
以及怎么设置?
jinye 2003-05-23
  • 打赏
  • 举报
回复
数据源设置。自己写或添加一个Connection 控件设置属性connectionstring就行。

110,566

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧