当前位置:网站首页>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
边栏推荐
- 【leetcode】107.二叉树的层序遍历II
- 解决VMware卸载后再安装出现的问题
- Linked list intersection (linked list)
- 第120章 SQL函数 ROUND
- Common DBA SQL statements (4) - Top SQL
- 2022 mobile crane driver test question bank simulation test platform operation
- Art template template engine
- [provincial election joint examination 2022 d2t1] card (state compression DP, FWT convolution)
- What if Jerry's function to locate the corresponding address is not accurate sometimes? [chapter]
- Read LSTM (long short term memory)
猜你喜欢
JVM——》常用参数
Jinglianwen technology - professional data annotation company and intelligent data annotation platform
基于PyQt5实现弹出任务进度条功能示例
深度选择器
2022 mobile crane driver test question bank simulation test platform operation
Configuration of LNMP
[provincial election joint examination 2022 d2t1] card (state compression DP, FWT convolution)
Comparison and practice of prototype design of knowledge service app
Shell script interaction free
mysql同一个表中相同数据怎么合并
随机推荐
Jerry's factors that usually affect CPU performance test results are: [article]
What are the system events of Jerry's [chapter]
Operation of 2022 tea artist (primary) test question simulation test platform
【leetcode】102.二叉树的层序遍历
142、环形链表||
Read LSTM (long short term memory)
Sim Api User Guide(6)
Shell script interaction free
CSP certification 202203-2 travel plan (multiple solutions)
JVM——》常用命令
C语言——自定义类型
Linked list intersection (linked list)
Comparison and practice of prototype design of knowledge service app
得到知识服务app原型设计比较与实践
Using idea to develop Spark Program
Jinglianwen technology - professional data annotation company and intelligent data annotation platform
解决方案架构师的小锦囊 - 架构图的 5 种类型
202、快乐数
Initial exploration of NVIDIA's latest 3D reconstruction technology instant NGP
101. Symmetric Tree