当前位置:网站首页>C#和数据库连接中类的问题
C#和数据库连接中类的问题
2022-04-23 10:16:00 【CSDN问答】
这样解释对吗
有人可以解决下我的问题吗
internal class lianjie
{
//为了使程序美观,创建多个类来进行数据库的连接
public SqlConnection connet()//创建类名为connet的类
{
string conStr = @"Data Source=LAPTOP-JA2J1QNT;Initial Catalog=bookmanagement;Integrated Security=SSPI"; SqlConnection sc=new SqlConnection(conStr); sc.Open(); return sc; }
采纳答案:
连接串不对。没有账号密码 都没有。
internal 不要用了 既然你封装起来 做链接 用 public 访问不受限制
求分
版权声明
本文为[CSDN问答]所创,转载请带上原文链接,感谢
https://ask.csdn.net/questions/7693251
边栏推荐
猜你喜欢

JVM——》常用命令

Sim Api User Guide(4)

shell脚本免交互
![Jerry's more accurate determination of abnormal address [chapter]](/img/ed/a08949bfc63823baf25fd57c324996.png)
Jerry's more accurate determination of abnormal address [chapter]

深度选择器

The central control learning infrared remote control module supports network and serial port control

MapReduce compression

IDEA——》每次启动都会Indexing或 scanning files to index

Windows installs redis and sets the redis service to start automatically

2022年流动式起重机司机考试题库模拟考试平台操作
随机推荐
杰理之AES能256bit吗【篇】
2022茶艺师(初级)考试试题模拟考试平台操作
Chapter 1 Oracle database in memory related concepts (im-1.1)
域名和IP地址的联系
What about Jerry's stack overflow? [chapter]
Jerry's factors that usually affect CPU performance test results are: [article]
Computer network security experiment II DNS protocol vulnerability utilization experiment
Sim Api User Guide(6)
DBA常用SQL语句(1)— 概况信息
DBA常用SQL语句(3)- cache、undo、索引和等待事件
第120章 SQL函数 ROUND
Turn: Maugham: reading is a portable refuge
SQL tuning series - SQL performance methodology
解决方案架构师的小锦囊 - 架构图的 5 种类型
【无标题】
Using multithreading to output abc10 times in sequence
142、环形链表||
SQL调优系列文章之—SQL性能方法论
202、快乐数
Sim Api User Guide(6)