博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
简单的sql server连接
阅读量:4606 次
发布时间:2019-06-09

本文共 956 字,大约阅读时间需要 3 分钟。

private string constring="data source=112.74.73.122;initial catalog=qzyData;user id=sa;password=11111111";        //18经度        //19纬度        private string FindUserMobilephone( )        {            string strCmd;            string phone = "";            strCmd = "select * from QZY_sites";            //PublicFunction.WriteLog("123: ", strCmd);            SqlConnection conn = new SqlConnection();            conn.ConnectionString = constring;            try            {                conn.Open();                SqlCommand cmd = new SqlCommand(strCmd, conn);                SqlDataReader rr = cmd.ExecuteReader();                while (rr.Read())                {                    phone += rr[1].ToString();                }            }            catch (SqlException sqle)            {                //PublicFunction.WriteLog("456: ", sqle.Message);            }            return phone;        }

 

转载于:https://www.cnblogs.com/SabWoF/p/6168220.html

你可能感兴趣的文章
A Simple Example About Privileged Methods in JavaScript
查看>>
Dynamics CRM Microsoft SQL Server 指定的数据库具有更高的版本号
查看>>
pm2进阶使用
查看>>
在c++中,静态数据成员可以被非静态成员函数调用吗?如果可以调用的话那为什么还要定义静态成员函数呢...
查看>>
查看Sql Server所有表占用的空间大小
查看>>
CSS重置(css reset)【转载】
查看>>
Elasticserach 配置文件详解
查看>>
【案例】大型摩托制造企业如何高效排产?看APS系统如何帮忙
查看>>
NTCIR-13 We Want Web 任务概述
查看>>
模版include的用法
查看>>
LotusScript_导出数据库路径和名称
查看>>
String ,StringBuffer 与S tringBuilder的区别??
查看>>
PgSQL · 追根究底 · WAL日志空间的意外增长
查看>>
struts2笔记之struts:property标签
查看>>
Threejs.教程
查看>>
超闩锁和子闩锁如何工作的
查看>>
ZendStudio快捷键
查看>>
[ovs] ovs开启日志debug
查看>>
Eclipse插件项目中读取文件
查看>>
jquery定义链接跳转的高亮显示
查看>>