当前位置:网站首页>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
边栏推荐
猜你喜欢

Zhengda international explains what the Dow Jones industrial index is?

101. Symmetric Tree

C语言——自定义类型

Arm debugging (1): two methods to redirect printf to serial port in keil

Windows installs redis and sets the redis service to start automatically

Juc并发编程07——公平锁真的公平吗(源码剖析)

Reading integrity monitoring techniques for vision navigation systems - 3 background

SQL Server 递归查询上下级

景联文科技—专业数据标注公司和智能数据标注平台

【leetcode】107.二叉树的层序遍历II
随机推荐
Zhengda international explains what the Dow Jones industrial index is?
Ansible cloud computing automation
Windows installs redis and sets the redis service to start automatically
App. In wechat applet JS files, components, APIs
ansible playbook语法和格式 自动化云计算
Read LSTM (long short term memory)
得到知识服务app原型设计比较与实践
59、螺旋矩阵(数组)
Question bank and answers of Shanghai safety officer C certificate examination in 2022
JVM——》常用参数
CentOS/Linux安装MySQL
59. Spiral matrix (array)
1、两数之和(哈希表)
349. Intersection of two arrays
定义链表(链表)
Sim Api User Guide(8)
Charles 功能介绍和使用教程
mysql同一个表中相同数据怎么合并
Depth selector
454. Sum of four numbers (hash table)