c# 操作mssql数据库 含有带参数sql语句运行
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="Default" value="Default" />
</appSettings>
<connectionStrings>
<add name="Default" connectionString="Data Source=192.168.1.197;User ID=diamond;Password=88888888;Initial Catalog=EmailAnalyse" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
namespace OfficeOutlook
{
/// <summary>
///DataBase 的摘要说明
/// </summary>
public class DataBase
{
protected SqlConnection BaseSqlConnection = new SqlConnection();//连接对象
protected SqlCommand BaseSqlCommand = new SqlCommand(); //命令对象
public DataBase()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
protected void OpenConnection()
{
if (BaseSqlConnection.State == ConnectionState.Closed) //连接是否关闭
try
{
&nb
相关文档:
SQL版:
alter proc testguo
(
@cityid int,
@cityname nvarchar(100) output
)
as
select @cityname = city_name from BA_Hot_City where cityid = @cityid
select @cityname
go
declare @cityname nvarchar(100)
exec testguo 1,@cityname output
另一版:
ht ......
贺州市疾病预防控制中心所用的ZmSoft从业体检信息网络系统V2010.1.26 正式版采用SQL SERVER2000平台,不明原因,数据库"置疑“,客户试过所有网上方法,未能解决.沈阳凯文数据恢复中心SQL数据库工程师成功将其解决.
沈阳凯文数据恢复中心MS SQL SERVER研发小组致力于MsSql数据库技术的研究。经过多年研究完全掌握了S ......
ASP.NET Excel导入到SQL Server数据库
提供把Excel里的数据导入到SQL Server 数据库,前提是Excel里的字段在Sql Server表里都有,不然会出现错误。注释很详细哦!要引用的命名空间是:
using System.Data.OleDb;
using System.Data.SqlClient;
//操作类
public class ExcelToSQL
{
& ......
用户、组或角色′sde'在当前数据库中已存在
Use dbName
go
sp_change_users_login ‘update_one’
,
‘loginName’
, ‘loginName‘
摘自:http://www.softbunny.net/post/SQL_Login_User.shtml
......
select convert(numeric(10,4),iinvnowcost) from ...
decimal 和 numeric (来源sql 联机丛书)
带定点精度和小数位数的 numeric 数据类型。
decimal[(p[, s])] 和 numeric[(p[, s])]
定点精度和小数位数。使用最大精度时,有效值从 - 10^38 +1 到 10^38 - 1。decimal 的 SQL-92 同义词是 dec 和 dec(p, s)。
p(精度) ......