C#连接SQLServer数据库
来源:互联网 发布:知恩于心 感恩于行 编辑:程序博客网 时间:2024/06/05 15:19
public string GetData() { try { SqlConnection sqlConnection = new SqlConnection( "Data Source=127.0.0.1;Initial Catalog=SalesERPDB;Integrated Security=True;User Id=sa;Password=123456"); sqlConnection.Open(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; sqlCommand.CommandType = CommandType.Text; sqlCommand.CommandText = "select FirstName from TblEmployee"; return sqlCommand.ExecuteScalar().ToString(); } catch (Exception ex) { return ex.ToString(); } }
阅读全文
0 0
- C#连接sqlserver数据库
- c#连接sqlserver数据库
- c#连接sqlserver数据库
- c#连接sqlserver数据库
- c#连接sqlserver数据库
- c#连接sqlserver数据库
- C#连接SQLServer数据库
- 用 C# 连接SQLSERVER 数据库
- C#程序连接SqlServer数据库
- C# 连接SQLSERVER数据库 连接字符串
- C# 连接数据库……sqlserver
- ASP.NET C# 连接 access sqlserver 数据库
- C#连接SQLServer数据库关键代码
- c#连接sqlserver数据库并显示
- C# 连接、操作SqlServer数据库--日常笔记
- C#连接Access数据库,C#连接Excel数据库,C#连接SqlServer数据库,C#连接Mysql数据库总结
- 用ASP.NET/C#连接Access和SQLServer数据库
- 用ASP.NET/C#连接Access和SQLServer数据库
- 设计模式之命令模式
- volatile理解与使用
- Oracle数据库常见的增删改查操作语句大全
- Error checking for billing v3 support. (response: 3:Billing Unavailable)
- c++\MFC测试代码的运行时间
- C#连接SQLServer数据库
- C# 为啥用invoke,实际上是处理多线程的问题
- 深入理解Glide源码,分析之路(一):基本用法,史上最详细、易懂
- bootstrap学习21--缩略图
- 设计模式之访问模式
- 从与星瑞格软件的合作看浪潮深化主机生态布局
- RESTful API 设计指南
- Scrapy学习笔记一:安装
- 在主方法中创建String对象,使用charAt()方法查看字符串str中索引位置是6的字符