This is part of the WPF controls
Public TeacherAddScore ()
{
InitializeComponent();
Ds=new studentDataSet ();
ScoreAdapter=new student. StudentDataSetTableAdapters. ScoreTableAdapter ();
StudentAdapter=new student. StudentDataSetTableAdapters. StudentTableAdapter ();
Dt=studentAdapter. GetData ();
}
StudentDataSet ds;
StudentDataSetTableAdapters. ScoreTableAdapter scoreAdapter;
StudentDataSetTableAdapters. StudentTableAdapter studentAdapter;
Public static DataTable dt;
Private void button1_Click (object sender, RoutedEventArgs e)
{
If (textBox1. Text. Length==0)
{
MessageBox. Show (" please fill out the subject ");
return;
}
ScoreAdapter. FillByClassName (ds) score, textBox1. Text);
DataRow Dr=null;
If (ds) Tables [r]. "score" Rows. Count==0)
{
for(int x=0; X
{
Dr=ds. Tables [r]. "score" NewRow ();
Dr [" StudentNum "]=the Convert. ToInt32 (dt) Rows [x] [0]. ToString ());
Dr [" ClassName "]=textBox1. Text;
Dr [" score "]=0;
Ds. Tables [r]. "score" Rows. The Add (Dr);
}
}
For the IsEnabled=false;
TextBox1. IsReadOnly=true;
ListView1. ItemsSource=ds. Tables [r]. "score" DefaultView;
}
Private void button2_Click (object sender, RoutedEventArgs e)
{
If (ds) HasChanges ())
{
StudentAdapter. Update (ds);
}
}
CodePudding user response:
Connect themselves to make small database
This is a teacher's window
Is saved into database
CodePudding user response:
CodePudding user response:
SqlCommandBuilder sqlcmdbuilder=new SqlCommandBuilder less SqlCommandBuilder (studentAdapter)?
CodePudding user response:
The