c# 读取数据库得到字符串
2024-08-26 08:37:23
public string GetProductType(string connectionString, string barCode)
{
string productType;
SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
//MessageBox.Show("连接成功");
string sqlCmd = "select 产品型号 from ProName where 壳体编号 = '"+ barCode + "'";
SqlCommand command = new SqlCommand(sqlCmd, conn);
SqlDataReader read = command.ExecuteReader();
if (read.Read())
{
productType = read["产品型号"].ToString();
conn.Close();
return productType;
}
}
最新文章
- php总结二篇
- python之ftplib库
- 10 个非常有用的 AngularJS 框架
- 数据绑定(八)使用Binding的RelativeSource
- 和阿木聊Node.js
- UTR#2 T1
- 【web开发学习笔记】Structs2 Action学习笔记(一个)
- 团队作业10——beta阶段项目复审
- 微信小程序免费Https获取以及Ubuntu Nginx配置
- 最近学习的 Node.js 数组_函数
- Redis主从同步原理-PSYNC【转】
- Anaconda 虚拟环境的使用
- TCP是如何保证可靠传输的
- DialogActivity
- 结构体内的函数与bfs的情景变量
- Spring线程池ThreadPoolTaskExecutor配置及详情
- BZOJ 1189 紧急疏散(二分+最大流)
- 日志体系——loging
- centos编译安装rabbitmq
- Git 之 配置文件与用户凭证
热门文章
- Github实战测试情况
- C#基础表达式语句详解(下)
- python 之Entry
- CSS换行知识
- Python程序设计例题
- MySQL实战45讲学习笔记:第三十讲
- EF Code Frist 执行 nuget命令
- BizTalk增强型RosettaNet跟踪报告
- 视觉融合定位github
- java.lang.IllegalStateException: Received message from unsupported version: [5.2.2] minimal compatible version is: [5.6.0]