ado.net保存 [英] ado.net saving

查看:83
本文介绍了ado.net保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,我想保存到我的sql服务器中的数据以进行简历项目,我希望当用户单击表单中的保存"按钮时如何保存所有数据,如何建立连接以及如何在sql server2005中保存数据

请给我解决方法

谢谢你……

hello friends i want to save to data in my sql server to project of resume i want all data atomatic save when user click save button in form how to make connection and how to save the data in sql server2005

please give me solution

Thank u......

推荐答案

在开始工作之前,您需要学习ADO.NET.这是一个CodeProject文章,您可以从这里开始:为初学者使用ADO.NET [ ^ ].另外,Google是您最好的朋友.

祝你好运.
Before you start working, you need to learn ADO.NET. Here is a CodeProject article that you can start with : Using ADO.NET for beginners[^]. Also, Google is your best friend.

Best of luck.


尝试这些

1.在ADO.Net上购买一本书并学习
2. ADO.Net上的Google
3.在MSDN上搜索样本
4.在C#上找到一些老师
Try these

1. Buy a book on ADO.Net and study
2. Google on ADO.Net
3. Search samples on MSDN
4. Find some teacher on C#


字符串str ="DataSource = ...;用户ID = ..;密码= ...;数据库= ...";
SqlConnection con =新的SqlConnection(str);
con.Open();
SqlCommand cmd =新的SqlCommand(插入TableName(列名)值()",con);
SqlDataReader dr;
dr = cmd.ExecuteReader();
int i = cmd.ExecuteNonQuery();
con.Close();


这是使用ado.net
string str="DataSource=...;User Id=..;Password=...;Database=...";
SqlConnection con=new SqlConnection(str);
con.Open();
SqlCommand cmd=new SqlCommand("Insert into TableName (Column Names) Values ()",con);
SqlDataReader dr;
dr=cmd.ExecuteReader();
int i=cmd.ExecuteNonQuery();
con.Close();


This is the Sample Code to insert the data into the Sql Server using ado.net


这篇关于ado.net保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆