资源简介
C#学生社团管理系统 (源代码+数据库+文档)
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace community
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SqlConnection conn = null;
SqlDataAdapter da = null;
DataSet ds = null;
SqlCommandBuilder myCB;
private void Form1_Load(object sender EventArgs e)
{
// TODO: 这行代码将数据加载到表“zhglDataSet5.massorganizationsmember”中。您可以根据需要移动或移除它。
this.massorganizationsmemberTableAdapter.Fill(this.zhglDataSet5.massorganizationsmember);
try
{
string s = “data source=localhost;database=zhgl;Integrated Security=True;Pooling=False“;
conn = new SqlConnection(s);
conn.Open();
}
catch (Exception e1)
{
MessageBox.Show(e1.Message “提示“);
}
da = new SqlDataAdapter();
ds = new DataSet();
string sql = “select * from massorganizationsinfo“;
da.SelectCommand = new SqlCommand(sql conn);
da.Fill(ds “mytable“);
myCB = new SqlCommandBuilder(da);
massorganizationsinfo.DataSource = ds;
massorganizationsinfo.DataMember = “mytable“;
dataGridView1.DataSource = massorganizationsinfo;
}
private void tabControl1_SelectedIndexChanged(object sender EventArgs e)
{
if (tabControl1.SelectedIndex == 1)
{
da = new SqlDataAdapter();
ds = new DataSet();
string sql = “select * from massorganizationsmember“;
da.SelectCommand = new SqlCommand(sql conn);
da.Fill(ds “mytable“);
myCB = new SqlCommandBuilder(da);
massorganizationsmember.DataSource = ds;
massorganizationsmember.DataMember = “mytable“;
dataGridView2.DataSource = massorganizationsmember;
}
if (tabControl1.SelectedIndex == 2)
{
da = new SqlDataAdapter();
ds = new DataSet();
string sql = “select * from massorganizationsexercise“;
da.SelectCommand = new SqlCommand(sql conn);
da.Fill(ds “mytable“);
myCB = new SqlCommandBuilder(da);
massorganizationsexercise.DataSource = ds;
massorganizationsexercise.DataMember = “mytable“;
dataGridView3.DataSource = massorganizationsexercise;
}
}
private void informationtextBox1_TextChanged(object sender EventArgs e)
{
string s = “data source=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 916 2011-06-18 16:26 community\community.sln
..A..H. 26624 2011-06-21 18:56 community\community.suo
文件 1 2011-06-18 16:50 community\community\ClassDiagram1.cd
文件 7466 2011-06-21 18:26 community\community\community.csproj
文件 168 2011-06-18 16:50 community\community\community.csproj.user
文件 468 2011-06-18 16:26 community\community\Program.cs
文件 46616 2011-06-18 16:54 community\community\zhglDataSet.Designer.cs
文件 3 2011-06-18 16:54 community\community\zhglDataSet.xsc
文件 12672 2011-06-18 16:54 community\community\zhglDataSet.xsd
文件 3 2011-06-18 16:54 community\community\zhglDataSet.xss
文件 609 2011-06-21 18:18 community\community\app.config
文件 12683 2011-06-21 18:18 community\community\zhglDataSet1.xsd
文件 46636 2011-06-21 18:18 community\community\zhglDataSet1.Designer.cs
文件 3 2011-06-21 18:18 community\community\zhglDataSet1.xss
文件 3 2011-06-21 18:18 community\community\zhglDataSet1.xsc
文件 11727 2011-06-21 18:19 community\community\zhglDataSet2.xsd
文件 45023 2011-06-21 18:19 community\community\zhglDataSet2.Designer.cs
文件 3 2011-06-21 18:19 community\community\zhglDataSet2.xss
文件 3 2011-06-21 18:19 community\community\zhglDataSet2.xsc
文件 14867 2011-06-21 18:20 community\community\zhglDataSet3.xsd
文件 50763 2011-06-21 18:20 community\community\zhglDataSet3.Designer.cs
文件 3 2011-06-21 18:20 community\community\zhglDataSet3.xss
文件 3 2011-06-21 18:20 community\community\zhglDataSet3.xsc
文件 12683 2011-06-21 18:24 community\community\zhglDataSet4.xsd
文件 46636 2011-06-21 18:24 community\community\zhglDataSet4.Designer.cs
文件 3 2011-06-21 18:24 community\community\zhglDataSet4.xss
文件 3 2011-06-21 18:24 community\community\zhglDataSet4.xsc
文件 11727 2011-06-21 18:25 community\community\zhglDataSet5.xsd
文件 45023 2011-06-21 18:25 community\community\zhglDataSet5.Designer.cs
文件 3 2011-06-21 18:25 community\community\zhglDataSet5.xss
............此处省略48个文件信息
- 上一篇:C#写性能服务器
- 下一篇:使用C#在Unity中制作VR游戏
评论
共有 条评论