如何在.net中配置自己的数据库

.net(二) 配置数据库 测试数据库 一、SQLServer数据库连接 连接有两种方式:VS自带数据服务管理、配置文件中设置 方法一: 选择服务器资源管理 -数据连接-添加连接(或点击图中图标) 服务器名选择要连接数据库的ip地址,身份验证:用户名/密码,选择要连接的数据库名称并测试连接是否成功。 连接成功后可以查看库中各表,以及表中数据 编辑demo,测试 [WebMethod] public string testSqlServer() ... 阅读详情

在VS2005中由于默认使用的是SQLServerExpress,想要是用自己的数据库需要重新设置。经过研究后总结一下连接步骤:

0 首先确保你的数据库服务启动着,并且创建好了相关的数据库。

1 在web.config中找到<connectionStrings>节点

 <connectionStrings>

 </connectionStrings>

那么你会看到这个节点是空或者已经有一个自己的连接,那么现在添加一个自己的连接串。

 <connectionStrings>
  <add name="LocalSqlServer" connectionString="Data Source=Localhost;Initial Catalog=XXX;Persist Security Info=True;User ID=xxx;Password=xxx"   providerName="System.Data.SqlClient" />
   </connectionStrings>

name是连接串的名称,connectionString中定义了你的连接串,你也可以在开发过程中随时利用name调用到这个连接串。

Data Source是你的数据库位置,Initial Catalog标识你的数据库名称,Persist Security Info设置安全信息,User ID=SDC;Password=SDCAdmin分别是数据库的用户名和密码。

providerName中描述的是使用的相关API所在的包。

 

如果你使用的是.net自带的一些数据库相关的控件,例如login控件。由于这些控件默认使用的是.netframework中的默认连接串:LocalSqlServer,你需要将他从你的配置中remov

SqlSugar:基于SQLSugar框架在 .Net环境中搭建PostgreSQL数据库访问、操作的框架,C#连接访问PostgreSQL数据库 本文描述了在.Net环境中使用SQLSugar框架连接及访问PostgreSQL数据库的详细操作过程,主要包括四个步骤:1 下载SqlSugar包 2 创建初始化并连接数据库工具类 3 创建数据操作类 4调用操作类访问数据库。 阅读详情

相关推荐

如何在.NET中连接到MySQL数据库

dbForge Studio for MySQL是一个在Windows平台被广泛使用的MySQL客户端,它能够使MySQL开发人员和管理人员在一个方便的环境中与他人一起完成创建和执行查询,开发和调试MySQL程序,自动化管理MySQL数据库对象等工作。 点击下载dbForge Studio for MySQL最新试用版 在.NET中连接到MySQL数据库 .NET是伟大的,它为数据库和数据源的工作提供了大量的工具。但有些时候,数据源可能并不被固有的支持。在MySQL这样的情况下,当你为项目创建绑定源或

qq_42444778的博客 786

.net core 读取 appsettings.json 配置文件,设置数据库链接

1、appsetting.json 配置 2、ConnectionStrings 对应的实体类 3、在startup.cs 读取 4、数据库链接

awei0130的博客 8259

高斯投影坐标正反算算法(python)

高斯坐标正反算算法,在正算的时候,y的第一个数字表示是用几度带换算的,第二个数字和第三个数字表示带号。该程序是根据武汉大学出版社出版的第三版的《大地测量学基础》编写, 用于课程实验学习。

weixin_64338372的博客 4594

k8s中如何使用gpu、gpu资源讲解、nvidia gpu驱动安装

gpu资源也是服务器中常见的一种资源,gpu即显卡,一般用在人工智能、图文识别、大模型等领域,其中nvidia gpu是nvidia公司生产的nvidia类型的显卡,amd gpu则是adm公司生产的amd类型gpu。企业中服务器最常见的就是英伟达gpu服务器了。本篇也主要讲解英伟达驱动相关的知识。

MssGuo的博客 1万+

保姆级教程:在Windows 11上用VSCode和Conda搞定Depth-Anything-3(含常见报错修复)

本文提供在Windows 11系统上使用VSCode和Conda配置Depth-Anything-3的完整教程,涵盖环境搭建、依赖安装、常见报错修复及深度图生成实战。特别针对CUDA与PyTorch版本匹配、Hugging Face镜像加速等关键问题提供解决方案,帮助开发者高效实现计算机视觉中的深度估计应用。

weixin_30338481的博客 353

中国全国地面站点数据(1981-2010)、月平均气象、月平均降水、月平均相对湿度、月最大降水、月最高温度最低温度、月最高温平均值最低温平均值、高低温站点基础数据,气候数据

中国全国地面站点数据(1981-2010)、月平均气象、月平均降水、月平均相对湿度、月最大降水、月最高温度最低温度、月最高温平均值最低温平均值、高低温站点基础数据 b_china_mon_avg_data_pressure月平均气象 b_china_mon_avg_data_rain月平均降水 b_china_mon_avg_data_rhu月平均相对湿度 b_china_mon_max_data_rain月最大降水 b_china_mon_max_min_data_tem月最高温度最低温度 b_china

无极低码 2万+

EtherCAT-7 从站代码移植-SPI

STM32F103 + AX58100,从站代码移植。

tianya_xuan的博客 3586

告别“静态组件”:Adobe XD的堆栈+状态,打造“活”的响应式UI

今天,我想分享一套能彻底告别这种“笨方法”的、Adobe XD中的进阶技巧,通过组合使用“堆栈”、“内边距”和“组件状态”,去构建一个能自动适应内容、真正“活”起来的智能响应式组件。

Kingsdesigner的博客 767

大疆司空 2 私有化部署:FH2、Terra、4G 三大服务区别详解

摘要: 司空2私有版包含三大模块:FH2(核心平台,必选)、Terra(建模算力,需NVIDIA显卡)、4G(内网图传)。FH2是基础,支持设备管理与任务调度;Terra适用于测绘建模场景,依赖GPU算力;4G模块保障复杂环境下的图传稳定性,适合纯内网部署。选择逻辑:先部署FH2,再按需添加Terra(需显卡)或4G(需内网支持),避免资源浪费。

2501_93651177的博客 593

ABAP CDS SELECT, parameters 全面解析:把参数化视图玩明白(含可运行示例)

这篇技术博客介绍了ABAP CDS中参数化视图的用法与实践。文章从业务需求出发,解释了参数化视图的必要性,并详细说明了语法规则、参数类型匹配、视图内部参数引用等关键点。重点展示了在JOIN和ASSOCIATION中传递参数的写法,提供了航线分析的完整业务案例和可运行代码示例。文章还总结了视图实体与DDIC视图的差异、会话变量使用技巧等实践要点,特别强调了JOIN中必须显式传参的语法要求。通过真实场景演示,帮助开发者掌握参数化CDS的高效应用。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 371

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

上一篇: ASP.net 中关于控件Treeview的操作------ 节点查找、删除和添加
下一篇: ReportViewer 导出Excel或PDF无法打开问题
Splendour
博客等级 码龄20年 8粉丝 50原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址