没有合适的资源?快使用搜索试试~ 我知道了~
C#代码打包
需积分: 17 4 下载量 159 浏览量
2013-07-06
22:35:48
上传
评论
收藏 2KB TXT 举报
温馨提示
![preview](https://dl-preview.csdnimg.cn/txt_preview/5713113/5713113_thumbnail_1.jpg?x-oss-process=style/thumbnail)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
试读
2页
较为详细的C#代码。可供需要的爱好者们参考。
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![iss](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
String connectionString = @"server=localhost;database=Northwind;uid=sa;pwd=sa";
SqlConnection mySqlConnection = new SqlConnection(connectionString);
SqlCommand mySqlCommand = mySqlConnection.CreateCommand();
string InsertString = "INSERT INTO Student(Student,Sex)VALUES('王二','男')";
mySqlCommand.CommandText = InsertString;
mySqlConnection.Open();
mySqlCommand.ExecuteNonQuery();
Console.Write("恭喜,输入新数据任务完成!");
mySqlConnection.Close();
string DeleteString = "DELETE FROM Student WHERE StudentName='huahua'";
mySqlCommand.CommandText = DeleteString;
mySqlConnection.Open();
mySqlCommand.ExecuteNonQuery();
Console.Write("恭喜,从Student删除指定任务完成!");
mySqlConnection.Close();
string ModifyString = "UPDATE Student SET Sex='女'WHERE StudentName='huahua'";
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
String connectionString = @"server=localhost;database=Northwind;uid=sa;pwd=sa";
SqlConnection mySqlConnection = new SqlConnection(connectionString);
SqlCommand mySqlCommand = mySqlConnection.CreateCommand();
string InsertString = "INSERT INTO Student(Student,Sex)VALUES('王二','男')";
mySqlCommand.CommandText = InsertString;
mySqlConnection.Open();
mySqlCommand.ExecuteNonQuery();
Console.Write("恭喜,输入新数据任务完成!");
mySqlConnection.Close();
string DeleteString = "DELETE FROM Student WHERE StudentName='huahua'";
mySqlCommand.CommandText = DeleteString;
mySqlConnection.Open();
mySqlCommand.ExecuteNonQuery();
Console.Write("恭喜,从Student删除指定任务完成!");
mySqlConnection.Close();
string ModifyString = "UPDATE Student SET Sex='女'WHERE StudentName='huahua'";
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
夏天袭梦
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)