日期:2014-05-16 浏览次数:20934 次
[csharp] view plaincopyprint?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace My_SQL
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.BindingContext[this.dataSet31, "Class1"].Position--;
}
private void button2_Click(object sender, EventArgs e)
{
this.BindingContext[this.dataSet31, "Class1"].Position++;
}
private void Form3_Load(object sender, EventArgs e)
{
comboBox1.Items.Clear();
comboBox1.DataSource = dataSet31.Tables["Class1"];
comboBox1.DisplayMember = "Naem";
this.sqlDataAdapter1.Fill(this.dataSet31, 0, 0, "Class1");
}
private void button3_Click(object sender, EventArgs e)
{
int dds = comboBox1.SelectedIndex;
string ds = comboBox1.Text;
SqlConnection con1 = new SqlConnection("Data Source=(local);database=msdb;Integrated Security=SSPI");
SqlCommand&