我有这么一张表studnet,表中的数据类似于这样
school,studentno,DN,parentname,relationship,mobile,address,note,status.
有两个按钮,删除,增加
当status=0的时候久执行删除,删除只需要删除school,studnetno,DN就可以了。当status=1的时候就执行增加。
我希望通过线程来这行这个两个操作
public class Form1 : System.Windows.Forms.Form
{
private Thread threadone;
private ThreadStart threadoneStart; private void button5_Click()
{
StudentThread();
}
private void StudentThread()
{
threadoneStart = new ThreadStart(student);
threadone = new Thread(threadoneStart);
threadone.Start();
}
private void student()
{
try
{
}
catch (exception ee)
{
Console.WriteLine(ee.Message);
}
}
}我现在不知道student方法里面怎么写,改怎么做判断,有如何向表里面增加或删除数据 ,请问各位高手指教
school,studentno,DN,parentname,relationship,mobile,address,note,status.
有两个按钮,删除,增加
当status=0的时候久执行删除,删除只需要删除school,studnetno,DN就可以了。当status=1的时候就执行增加。
我希望通过线程来这行这个两个操作
public class Form1 : System.Windows.Forms.Form
{
private Thread threadone;
private ThreadStart threadoneStart; private void button5_Click()
{
StudentThread();
}
private void StudentThread()
{
threadoneStart = new ThreadStart(student);
threadone = new Thread(threadoneStart);
threadone.Start();
}
private void student()
{
try
{
}
catch (exception ee)
{
Console.WriteLine(ee.Message);
}
}
}我现在不知道student方法里面怎么写,改怎么做判断,有如何向表里面增加或删除数据 ,请问各位高手指教
{
get
{
if (ViewState["status"] != null)
{
return Convert.ToBoolean(ViewState["status"]);
}
else
{
return false;
}
}
set
{
ViewState["status"] = value;
}
}
private void student()
{
try
{
lock (typeof(Thread))
{
if (status)
{
insert()//对表进行增加操作
status = false;
}
else
{
delete();//对表进行删除操作
status = true;
}
}
}
catch (exception ee)
{
Console.WriteLine(ee.Message);
}
}