当前位置:网站首页>Problems of class in C # and database connection
Problems of class in C # and database connection
2022-04-23 10:29:00 【CSDN Q & A】
Is that right
Can someone solve my problem
internal class lianjie
{
// In order to make the program beautiful , Create multiple classes to connect to the database
public SqlConnection connet()// Create a class named connet Class
{
string conStr = @"Data Source=LAPTOP-JA2J1QNT;Initial Catalog=bookmanagement;Integrated Security=SSPI"; SqlConnection sc=new SqlConnection(conStr); sc.Open(); return sc; }
Take the answer :
Wrong connection string . No account password None .
internal Don't use Since you encapsulate Make links use public Unlimited access
Score
版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204161913536128.html
边栏推荐
- Jinglianwen technology - professional data annotation company and intelligent data annotation platform
- 转:毛姆:阅读是一座随身携带的避难所
- 第一章 Oracle Database In-Memory 相关概念(续)(IM-1.2)
- 209、长度最小的子数组(数组)
- SSH uses private key to connect to server without key
- /etc/shadow可以破解吗?
- 19、删除链表的倒数第N个节点(链表)
- Six practices of Windows operating system security attack and defense
- Wonderful review | deepnova x iceberg meetup online "building a real-time data Lake based on iceberg"
- DBA common SQL statements (3) - cache, undo, index and wait events
猜你喜欢

Depth selector

Six practices of Windows operating system security attack and defense

lnmp的配置

微信小程序简介、发展史、小程序的优点、申请账号、开发工具、初识wxml文件和wxss文件

Windows installs redis and sets the redis service to start automatically

Comparison and practice of prototype design of knowledge service app

Reading integrity monitoring techniques for vision navigation systems - 3 background

Sim Api User Guide(4)

JUC concurrent programming 07 -- is fair lock really fair (source code analysis)

基于PyQt5实现弹出任务进度条功能示例
随机推荐
景联文科技—专业数据标注公司和智能数据标注平台
解决方案架构师的小锦囊 - 架构图的 5 种类型
net start mysql MySQL 服务正在启动 . MySQL 服务无法启动。 服务没有报告任何错误。
C#和数据库连接中类的问题
【无标题】
Operation of 2022 tea artist (primary) test question simulation test platform
SQL server query database deadlock
MapReduce core and foundation demo
Juc并发编程09——Condition实现源码分析
基于PyQt5实现弹出任务进度条功能示例
Using multithreading to output abc10 times in sequence
Solution architect's small bag - 5 types of architecture diagrams
LeetCode-608. Tree node
Sim Api User Guide(4)
一文看懂 LSTM(Long Short-Term Memory)
DBA common SQL statements (1) - overview information
202. Happy number
转:毛姆:阅读是一座随身携带的避难所
Sim Api User Guide(8)
SSH利用私钥无密钥连接服务器踩坑实录