--------------------
閱讀本主題的最佳解答--------------------

請問各位大大:
在C#中新增一個Button,主要功能是要清除所連結的資料庫裡面的內容
請問應該要怎麼寫呢??
另外,在下面的程式中,執行時在連結資料庫的時候似乎會有問題,請問大概是哪邊有問題呢?
謝謝各位大大的悉心解答~
private void Timer_Action_Tick(object sender, EventArgs e)
{
try
{
DataRow row = fpsdbDataSet.Tables[0].Rows[m_Pos];
axRemoteSetup.Load();
int i;
for (i = 0; i < m_DVRCHANNEL ; i++)
{
axRemoteSetup.GetCam(i, "camtype", out(m_ANALOG));
axRemoteSetup.SetCam(i, "enable", row[5].ToString());
axRemoteSetup.SetNetworkService("rmapi", "monitor_framerate", row[6].ToString());
if (m_ANALOG == "Analog")
{
axRemoteSetup.SetCam(i, "resxy", row[2].ToString());
axRemoteSetup.SetCam(i, "quality", row[3].ToString());
axRemoteSetup.SetCam(i, "save_disk_space", row[4].ToString());
}
else break;
}
Timer_Action.Interval = 1000 * 60 * Convert.ToInt16(row[1]);
m_Pos++;
axRemoteSetup.Save();
if (axRemoteSetup.LastTransferStatus ==Convert .ToInt16 ( Setupstatus.UNMONITOR))
{
listBox_SetupLog.Items.Add("DVR isn't in monitor status");
Timer_Action.Enabled = false;
}
else if (axRemoteSetup.LastTransferStatus ==Convert .ToInt16 ( Setupstatus.SUCCESS))
{
string date,time;
axRemoteSetup.GetTimeInfo("datetime", "date", out(date));
axRemoteSetup.GetTimeInfo ("datetime","time",out(time));
listBox_SetupLog.Items.Add("No. " + row[0] + " Status:Success Windows Local Time:"+DateTime.Now+" DVR Local Tome:"+date+time);
}
else
{
listBox_SetupLog.Items.Add("Remote setup Faill");
Timer_Action.Enabled = false;
}
}
catch (Exception)
{
Timer_Action.Enabled = false;
button_StartFps.Enabled = true;
}
}