0
我在Microsoft Office Access中創建了一個數據庫。在form1.cs
我添加了一個DataGridView
與創建的數據庫的來源。在tableDataSet.xsd/tabelAdapter
我創建了一個新的查詢與3個參數,我用這個數據插入數據庫(Name, Password, Age)
。我如何使用這個查詢與3個不同的textbox
3參數?如何在C#(而不是web)中使用查詢?
PS:我只用Windows窗體應用程序,沒有asp.net或者等
代碼:
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;
namespace lucian
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'jucatoriDataSet.jucator' table. You can move, or remove it, as needed.
this.jucatorTableAdapter.Fill(this.jucatoriDataSet.jucator);
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void adaugareToolStripButton_Click(object sender, EventArgs e)
{
try
{
this.jucatorTableAdapter.Fill(this.jucatoriDataSet.jucator);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
它是唯一的解決方案? – 2013-03-19 10:46:06
或者實體框架可能是nhibernate或者其他一些我目前不知道的ORM – TalentTuner 2013-03-19 10:47:48