PDA端的數據庫一般采用的是sqlce數據庫

PDA端的數據庫一般采用的是sqlce數據庫,這樣與PC端的sql2000中的數據同步就變成了一個問題,如在PDA端處理,PDA端的內存,CPU等都是一個制約因素,其次他們的一個連接穩定及其間的數據傳輸也是一個難點.本例中通過在PC端的轉化后再復制到PDA上面,這樣,上面所有的問題都得到了一個有效的控制.

一,創建項目,添加引用?

二 設計界面,編寫代碼

程序代碼

?

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?System.Data.SqlServerCe;
using?OpenNETCF.Desktop.Communication;
using?System.IO;
using?System.Collections;

namespace?FyfjmFileChange
{
????
public?partial?class?MainForm?:?Form
????
{
????????
string?_strCurrentDirectory?=?System.IO.Directory.GetCurrentDirectory();
????????RAPI?m_rapi?
=?new?RAPI();
????????
private?ArrayList?_arrData?=?new?ArrayList();
????????
private?string[]?Temp;
????????
private?int?sign;

????????
public?MainForm()
????????
{
????????????InitializeComponent();
????????}


????????
private?void?btOpenFile_Click(object?sender,?EventArgs?e)
????????
{
????????????
if?(openFileDialog.ShowDialog()?==?DialogResult.OK)
????????????
{
????????????????tbSourceLoadFile.Text?
=?openFileDialog.FileName;
????????????}

????????}


????????
private?void?btSaveFile_Click(object?sender,?EventArgs?e)
????????
{
????????????
if?(saveFileDialog.ShowDialog()?==?DialogResult.OK)
????????????
{
????????????????tbLoadPurposeFile.Text?
=?saveFileDialog.FileName;
????????????}

????????}


????????
private?void?btUp1Load_Click(object?sender,?EventArgs?e)
????????
{
????????????sign?
=?1;
????????????lbDownLoadState.Text?
=?"Status:Ready?Up……";

????????????Cursor.Current?
=?Cursors.WaitCursor;

????????????DataAcess.DisConnection();

????????????
if?(tbLoadPurposeFile.Text.Trim().Length?>?0?&&?tbPdaSourceFile.Text.Trim().Length?>?0)
????????????
{
????????????????
try
????????????????
{
????????????????????lbDownLoadState.Text?
=?"Status:Copying?the?File……";

????????????????????m_rapi.Connect(
false,?-1);
????????????????????m_rapi.CopyFileFromDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaSourceFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????m_rapi.Disconnect();

????????????????????lbDownLoadState.Text?
=?"Status:Changing?the?File……";

????????????????????
if?(FileFormCeDataBase(tbLoadPurposeFile.Text.Trim()))
????????????????????
{
????????????????????????MessageBox.Show(
"File?Update?successful",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Successful……";
????????????????????}

????????????????????
else
????????????????????
{
????????????????????????MessageBox.Show(
"DataFile?Change?Failed",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????????}

????????????????}

????????????????
catch?(RAPIException?ex)
????????????????
{
????????????????????System.Windows.Forms.MessageBox.Show(ex.Message,?
"System?Message");

????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????}

????????????}


????????????Cursor.Current?
=?Cursors.Default;
????????}


????????
private?void?btDownLoadStop_Click(object?sender,?EventArgs?e)
????????
{
????????????Close();
????????}


????????
private?void?btDownLoad_Click(object?sender,?EventArgs?e)
????????
{
????????????Cursor.Current?
=?Cursors.WaitCursor;

????????????
if?(tbSourceLoadFile.Text.Trim().Length?>?0?&&?tbPdaPurposeFile.Text.Trim().Length?>?0)
????????????
{
????????????????
if?(MessageBox.Show("Are?you?Sure?to?clear?the?SKU?data",?"System?Message",?MessageBoxButtons.OKCancel,?MessageBoxIcon.Question,?MessageBoxDefaultButton.Button2)?==?DialogResult.OK)
????????????????
{
????????????????????
try
????????????????????
{
????????????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????????????
string?_strSQL?=?"delete?from?Enquiry";

????????????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????????????_objComm.CommandText?
=?_strSQL;
????????????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????????????_objComm.ExecuteNonQuery();
????????????????????}

????????????????????
catch?(SqlCeException?ex)
????????????????????
{
????????????????????????MessageBox.Show(
"Delete?data?Failed "?+?ex.Message,?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Exclamation,?MessageBoxDefaultButton.Button1);
????????????????????????
return;
????????????????????}

????????????????}


????????????????
if?(File.Exists(tbSourceLoadFile.Text.Trim())?&&?FileToCeDataBase(tbSourceLoadFile.Text.Trim()))
????????????????
{
????????????????????
try
????????????????????
{
????????????????????????DataAcess.Dispose();???????????
//在復制之前要關閉數據庫
????????????????????????
//????????????????????????while?(DataAcess._objConn.State?==?ConnectionState.Closed)
????????????????????????
//????????????????????????{
????????????????????????m_rapi.Connect(false,?-1);
????????????????????????m_rapi.CopyFileToDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaPurposeFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????????m_rapi.Disconnect();
????????????????????????MessageBox.Show(
"Down?File?to?device?successful",?"System?Message");
????????????????????????
//????????????????????????}
????????????????????}

????????????????????
catch?(RAPIException?ex)
????????????????????
{
????????????????????????System.Windows.Forms.MessageBox.Show(ex.Message,?
"System?Message");
????????????????????}

????????????????????
//}
????????????????}

????????????????
else
????????????????
{
????????????????????MessageBox.Show(
"The?SourceFile?not?exist",?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk);
????????????????}


????????????????Cursor.Current?
=?Cursors.Default;
????????????????DownLoadProgressBar.Value?
=?0;
????????????}

????????}


????????
private?void?UpStop_Click(object?sender,?EventArgs?e)
????????
{
????????????Close();
????????}


????????
private?bool?SaveTxt(string?strFilePath)
????????
{
????????????
bool?_bResult?=?false;
????????????DataSet?_objDs?
=?new?DataSet();
????????????
try
????????????
{
????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????_objComm.CommandText?
=?"SELECT?SKU?FROM?Take?where?Take_sign?=??'0'";
????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????SqlCeDataAdapter?_objDa?
=?new?SqlCeDataAdapter(_objComm);
????????????????SqlCeCommandBuilder?_objCb?
=?new?SqlCeCommandBuilder(_objDa);
????????????????_objDa.Fill(_objDs);

????????????????UpLoadProgressBar.Maximum?
=?_objDs.Tables[0].Rows.Count;
????????????????UpLoadProgressBar.Step?
=?0;

????????????????System.IO.StreamWriter?_objWriter?
=?new?StreamWriter(strFilePath,?false,?System.Text.Encoding.UTF8);

????????????????
int?i?=?0;
????????????????
foreach?(DataRow?_objDr?in?_objDs.Tables[0].Rows)
????????????????
{
????????????????????
string?_sLine?=?_objDr[0]?+?","?+?"1";
????????????????????_objWriter.WriteLine(_sLine);

????????????????????i
++;
????????????????????UpLoadProgressBar.Value?
=?i;
????????????????}

????????????????_objWriter.Close();

????????????????DataAcess.Close();
????????????????_objConn.Close();
????????????????_objConn.Dispose();
????????????????_objConn?
=?null;
????????????????_objComm.Dispose();
????????????????_bResult?
=?true;
????????????????
????????????}

????????????
catch?(SqlCeException?ex)
????????????
{
????????????????MessageBox.Show(ex.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}

????????????
catch?(Exception?ex1)
????????????
{
????????????????MessageBox.Show(ex1.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}


????????????
return?_bResult;
????????}


????????
private?bool?FileFormCeDataBase(string?strFilePath)
????????
{
????????????
bool?_bResult?=?false;
????????????
string[]?_strTemp?=?strFilePath.Split('.');
????????????
string?_strFileStype?=?_strTemp[_strTemp.Length?-?1];
????????????
switch?(_strFileStype.ToUpper())
????????????
{
????????????????
/*case?"XLS":
????????????????????_bResult?=?SaveXLS(strFilePath);
????????????????????break;
????????????????case?"CSV":
????????????????????_bResult?=?SaveCSV(strFilePath);
????????????????????break;
*/

????????????????
case?"TXT":
????????????????????
switch?(sign)
????????????????????
{
????????????????????????
case?1:
????????????????????????????_bResult?
=?SaveTxt(strFilePath);
????????????????????????????
break;
????????????????????????
case?2:
????????????????????????????_bResult?
=?SumSaveTxt(strFilePath);
????????????????????????????
break;
????????????????????????
case?3:
????????????????????????????_bResult?
=?AllSaveTxt(strFilePath);
????????????????????????????
break;
????????????????????????
default:
????????????????????????????
break;
????????????????????}

????????????????????
break;
????????????????
default:
????????????????????
{
????????????????????????MessageBox.Show(
"File?Format?Error",?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk);
????????????????????????
break;
????????????????????}

????????????}


????????????UpLoadProgressBar.Value?
=?0;

????????????
return?_bResult;
????????}


????????
private?bool?FileToCeDataBase(string?strFilePath)
????????
{
????????????
bool?_bResult?=?false;
????????????
try
????????????
{
????????????????_arrData?
=?new?ArrayList();
????????????????System.IO.StreamReader?objectReader?
=?new?System.IO.StreamReader(strFilePath,?System.Text.Encoding.UTF8);
????????????????
string?sLine?=?"";

????????????????
while?(sLine?!=?null)
????????????????
{
????????????????????sLine?
=?objectReader.ReadLine();
????????????????????
if?(sLine?!=?null)
????????????????????
{
????????????????????????_arrData.Add(sLine);
????????????????????}

????????????????}

????????????????objectReader.Close();
????????????}

????????????
catch?(Exception?ex)
????????????
{
????????????????MessageBox.Show(ex.Message,?
"系統提示",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}


????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();

????????????DownLoadProgressBar.Maximum?
=?_arrData.Count;
????????????DownLoadProgressBar.Step?
=?1;

????????????
for?(int?j?=?0;?j?<?_arrData.Count;?j++)
????????????
{
????????????????Temp?
=?_arrData[j].ToString().Trim().Split(',');
????????????????_objComm.CommandText?
=?string.Format("insert?into?Enquiry(Code,Color,Size,Price,SKU)?values('{0}','{1}','{2}','{3}','{4}')",?Temp[0].Trim(),?Temp[1].Trim(),?Temp[2].Trim(),?Temp[3].Trim(),?Temp[4].Trim());
????????????????_objComm.ExecuteNonQuery();

????????????????DownLoadProgressBar.Value
++;
????????????}

????????????_arrData.Clear();
????????????_bResult?
=?true;

????????????_objConn.Close();
????????????_objConn.Dispose();
????????????_objConn?
=?null;
????????????_objComm.Dispose();
????????????
return?_bResult;
????????????
????????}


????????
private?void?btUp2Load_Click(object?sender,?EventArgs?e)
????????
{
????????????sign?
=?2;
????????????lbDownLoadState.Text?
=?"Status:Ready?Up……";

????????????Cursor.Current?
=?Cursors.WaitCursor;

????????????DataAcess.DisConnection();

????????????
if?(tbLoadPurposeFile.Text.Trim().Length?>?0?&&?tbPdaSourceFile.Text.Trim().Length?>?0)
????????????
{
????????????????
try
????????????????
{
????????????????????lbDownLoadState.Text?
=?"Status:Copying?the?File……";

????????????????????m_rapi.Connect(
false,?-1);
????????????????????m_rapi.CopyFileFromDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaSourceFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????m_rapi.Disconnect();

????????????????????lbDownLoadState.Text?
=?"Status:Changing?the?File……";

????????????????????
if?(FileFormCeDataBase(tbLoadPurposeFile.Text.Trim()))
????????????????????
{
????????????????????????MessageBox.Show(
"File?Update?successful",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Successful……";
????????????????????}

????????????????????
else
????????????????????
{
????????????????????????MessageBox.Show(
"DataFile?Change?Failed",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????????}

????????????????}

????????????????
catch?(RAPIException?ex)
????????????????
{
????????????????????System.Windows.Forms.MessageBox.Show(ex.Message,?
"System?Message");

????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????}

????????????}


????????????Cursor.Current?
=?Cursors.Default;
????????}


????????
private?bool?SumSaveTxt(string?strFilePath)
????????
{
????????????
bool?_bResult?=?false;
????????????DataSet?_objDs?
=?new?DataSet();
????????????
try
????????????
{
????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????_objComm.CommandText?
=?"select?SKU,Count(*)as?Qty?from?Take?where?Take_sign?=?'0'?Group?By?SKU";
????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????SqlCeDataAdapter?_objDa?
=?new?SqlCeDataAdapter(_objComm);
????????????????SqlCeCommandBuilder?_objCb?
=?new?SqlCeCommandBuilder(_objDa);
????????????????_objDa.Fill(_objDs);

????????????????UpLoadProgressBar.Maximum?
=?_objDs.Tables[0].Rows.Count;
????????????????UpLoadProgressBar.Step?
=?0;

????????????????System.IO.StreamWriter?_objWriter?
=?new?StreamWriter(strFilePath,?false,?System.Text.Encoding.UTF8);

????????????????
int?i?=?0;
????????????????
foreach?(DataRow?_objDr?in?_objDs.Tables[0].Rows)
????????????????
{
????????????????????
string?_sLine?=?_objDr[0]?+?","?+?_objDr[1];
????????????????????_objWriter.WriteLine(_sLine);

????????????????????i
++;
????????????????????UpLoadProgressBar.Value?
=?i;
????????????????}

????????????????_objWriter.Close();

????????????????DataAcess.Close();
????????????????_objConn.Close();
????????????????_objConn.Dispose();
????????????????_objConn?
=?null;
????????????????_objComm.Dispose();
????????????????_bResult?
=?true;

????????????}

????????????
catch?(SqlCeException?ex)
????????????
{
????????????????MessageBox.Show(ex.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}

????????????
catch?(Exception?ex1)
????????????
{
????????????????MessageBox.Show(ex1.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}


????????????
return?_bResult;
????????}


????????
private?void?btTake_Click(object?sender,?EventArgs?e)
????????
{
????????????Cursor.Current?
=?Cursors.WaitCursor;
????????????
if?(MessageBox.Show("Are?you?Sure?to?clear?the?Stock?Take?data",?"System?Message",?MessageBoxButtons.OKCancel,?MessageBoxIcon.Question,?MessageBoxDefaultButton.Button2)?==?DialogResult.OK)
????????????
{
????????????????
try
????????????????
{
????????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????????
string?_strSQL1?=?"delete?from?Take";

????????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????????_objComm.CommandText?
=?_strSQL1;
????????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????????_objComm.ExecuteNonQuery();

????????????????????DataAcess.Dispose();???????????
//在復制之前要關閉數據庫
????????????????????m_rapi.Connect(false,?-1);
????????????????????m_rapi.CopyFileToDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaPurposeFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????m_rapi.Disconnect();
????????????????????MessageBox.Show(
"Delete?Successful!",?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Information,?MessageBoxDefaultButton.Button1);
????????????????}

????????????????
catch?(SqlCeException?ex)
????????????????
{
????????????????????MessageBox.Show(
"Delete?data?Failed "?+?ex.Message,?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Exclamation,?MessageBoxDefaultButton.Button1);
????????????????????
return;
????????????????}

????????????}

????????????Cursor.Current?
=?Cursors.Default;
????????}


????????
private?void?btAllclear_Click(object?sender,?EventArgs?e)
????????
{
????????????
if?(MessageBox.Show("Are?you?Sure?to?clear?all?the?data",?"System?Message",?MessageBoxButtons.OKCancel,?MessageBoxIcon.Question,?MessageBoxDefaultButton.Button2)?==?DialogResult.OK)
????????????
{
????????????????
try
????????????????
{
????????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????????
string?_strSQL?=?"delete?from?Take";
????????????????????
string?_strSQL1?=?"delete?from?Enquiry";

????????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????????_objComm.CommandText?
=?_strSQL;
????????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????????_objComm.ExecuteNonQuery();

????????????????????_objComm.CommandText?
=?_strSQL1;
????????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????????_objComm.ExecuteNonQuery();

????????????????????DataAcess.Dispose();???????????
//在復制之前要關閉數據庫
????????????????????m_rapi.Connect(false,?-1);
????????????????????m_rapi.CopyFileToDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaPurposeFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????m_rapi.Disconnect();

????????????????????MessageBox.Show(
"Delete?Successful!",?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Information,?MessageBoxDefaultButton.Button1);
????????????????}

????????????????
catch?(SqlCeException?ex)
????????????????
{
????????????????????MessageBox.Show(
"Delete?data?Failed "?+?ex.Message,?"System?Message",?MessageBoxButtons.OK,?MessageBoxIcon.Exclamation,?MessageBoxDefaultButton.Button1);
????????????????????
return;
????????????????}

????????????}

????????}


????????
private?void?btUp3Load_Click(object?sender,?EventArgs?e)
????????
{
????????????sign?
=?3;
????????????lbDownLoadState.Text?
=?"Status:Ready?Up……";

????????????Cursor.Current?
=?Cursors.WaitCursor;

????????????DataAcess.DisConnection();

????????????
if?(tbLoadPurposeFile.Text.Trim().Length?>?0?&&?tbPdaSourceFile.Text.Trim().Length?>?0)
????????????
{
????????????????
try
????????????????
{
????????????????????lbDownLoadState.Text?
=?"Status:Copying?the?File……";

????????????????????m_rapi.Connect(
false,?-1);
????????????????????m_rapi.CopyFileFromDevice(_strCurrentDirectory?
+?@"DataBaseFyfjm.sdf",?tbPdaSourceFile.Text.Trim()?+?@"DataBaseFyfjm.sdf",?true);
????????????????????m_rapi.Disconnect();

????????????????????lbDownLoadState.Text?
=?"Status:Changing?the?File……";

????????????????????
if?(FileFormCeDataBase(tbLoadPurposeFile.Text.Trim()))
????????????????????
{
????????????????????????MessageBox.Show(
"File?Update?successful",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Successful……";
????????????????????}

????????????????????
else
????????????????????
{
????????????????????????MessageBox.Show(
"DataFile?Change?Failed",?"System?Message");

????????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????????}

????????????????}

????????????????
catch?(RAPIException?ex)
????????????????
{
????????????????????System.Windows.Forms.MessageBox.Show(ex.Message,?
"System?Message");

????????????????????lbDownLoadState.Text?
=?"Status:Failed……";
????????????????}

????????????}


????????????Cursor.Current?
=?Cursors.Default;
????????}


????????
private?bool?AllSaveTxt(string?strFilePath)
????????
{
????????????
bool?_bResult?=?false;
????????????DataSet?_objDs?
=?new?DataSet();
????????????
try
????????????
{
????????????????SqlCeConnection?_objConn?
=?DataAcess.CreateConnection(_strCurrentDirectory?+?@"DataBaseFyfjm.sdf");
????????????????SqlCeCommand?_objComm?
=?_objConn.CreateCommand();
????????????????_objComm.CommandText?
=?"select?SKU,Zone,Take_sign?from?Take";
????????????????_objComm.CommandType?
=?CommandType.Text;
????????????????SqlCeDataAdapter?_objDa?
=?new?SqlCeDataAdapter(_objComm);
????????????????SqlCeCommandBuilder?_objCb?
=?new?SqlCeCommandBuilder(_objDa);
????????????????_objDa.Fill(_objDs);

????????????????UpLoadProgressBar.Maximum?
=?_objDs.Tables[0].Rows.Count;
????????????????UpLoadProgressBar.Step?
=?0;

????????????????System.IO.StreamWriter?_objWriter?
=?new?StreamWriter(strFilePath,?false,?System.Text.Encoding.UTF8);

????????????????
int?i?=?0;
????????????????
foreach?(DataRow?_objDr?in?_objDs.Tables[0].Rows)
????????????????
{
????????????????????
string?_sLine?=?_objDr[1]?+?","?+?_objDr[0]?+?","?+?"1"?+?","?+?_objDr[2];
????????????????????_objWriter.WriteLine(_sLine);

????????????????????i
++;
????????????????????UpLoadProgressBar.Value?
=?i;
????????????????}

????????????????_objWriter.Close();

????????????????DataAcess.Close();
????????????????_objConn.Close();
????????????????_objConn.Dispose();
????????????????_objConn?
=?null;
????????????????_objComm.Dispose();
????????????????_bResult?
=?true;

????????????}

????????????
catch?(SqlCeException?ex)
????????????
{
????????????????MessageBox.Show(ex.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}

????????????
catch?(Exception?ex1)
????????????
{
????????????????MessageBox.Show(ex1.Message,?
"系統提示:",?MessageBoxButtons.OK,?MessageBoxIcon.Asterisk,?MessageBoxDefaultButton.Button1);
????????????}


????????????
return?_bResult;
????????}


????}

}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/389222.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389222.shtml
英文地址,請注明出處:http://en.pswp.cn/news/389222.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

bzoj 1016 [JSOI2008]最小生成樹計數——matrix tree(相同權值的邊為階段縮點)(碼力)...

題目&#xff1a;https://www.lydsy.com/JudgeOnline/problem.php?id1016 就是縮點&#xff0c;每次相同權值的邊構成的聯通塊求一下matrix tree。注意gauss里的編號應該是從1到...的連續的。 學習了一個TJ。用了vector。自己曾寫過一個只能過樣例的。都放上來吧。 路徑壓縮的…

區塊鏈的模型結構

關于區塊鏈的模型結構問題&#xff0c;行業內已經談論千萬遍了&#xff0c;基本上已經成為一種定義式的問題了。總體上來看&#xff0c;區塊鏈的基礎架構可以分為六層&#xff0c;包括數據層、網絡層、共識層、激勵層、合約層、應用層。每一層分別完成一項核心的功能&#xff0…

數據科學家 數據工程師_數據科學家應該對數據進行版本控制的4個理由

數據科學家 數據工程師While working in a software project it is very common and, in fact, a standard to start right away versioning code, and the benefits are already pretty obvious for the software community: it tracks every modification of the code in a p…

JDK 下載相關資料

所有版本JDK下載地址&#xff1a; http://www.oracle.com/technetwork/java/archive-139210.html 下載賬戶密碼&#xff1a; 2696671285qq.com Oracle123 轉載于:https://www.cnblogs.com/bg7c/p/9277729.html

商米

2019獨角獸企業重金招聘Python工程師標準>>> 今天看了一下商米的官網&#xff0c;發現他家的東西還真的是不錯。有錢了&#xff0c;想去體驗一下。 如果我妹妹還有開便利店的話&#xff0c;我會推薦他用這個。小巧便捷&#xff0c;非常方便。 轉載于:https://my.osc…

C#生成安裝文件后自動附加數據庫的思路跟算法

using System; using System.Collections.Generic; using System.Windows.Forms; using System.Data.SqlClient; using System.Data; using System.ServiceProcess; namespace AdminZJC.DataBaseControl { /// <summary> /// 數據庫操作控制類 /// </summary> …

python交互式和文件式_使用Python創建和自動化交互式儀表盤

python交互式和文件式In this tutorial, I will be creating an automated, interactive dashboard of Texas COVID-19 case count by county using python with the help of selenium, pandas, dash, and plotly. I am assuming the reader has some familiarity with python,…

不可不說的Java“鎖”事

2019獨角獸企業重金招聘Python工程師標準>>> 前言 Java提供了種類豐富的鎖&#xff0c;每種鎖因其特性的不同&#xff0c;在適當的場景下能夠展現出非常高的效率。本文旨在對鎖相關源碼&#xff08;本文中的源碼來自JDK 8&#xff09;、使用場景進行舉例&#xff0c…

數據可視化 信息可視化_可視化數據以幫助清理數據

數據可視化 信息可視化The role of a data scientists involves retrieving hidden relationships between massive amounts of structured or unstructured data in the aim to reach or adjust certain business criteria. In recent times this role’s importance has been…

VS2005 ASP.NET2.0安裝項目的制作(包括數據庫創建、站點創建、IIS屬性修改、Web.Config文件修改)

站點&#xff1a; 如果新建默認的Web安裝項目&#xff0c;那它將創建的默認網站下的一個虛擬應用程序目錄而不是一個新的站點。故我們只有創建新的安裝項目&#xff0c;而不是Web安裝項目。然后通過安裝類進行自定義操作&#xff0c;創建新站如下圖&#xff1a; 2、創建新的安項…

docker的基本命令

docker的三大核心&#xff1a;倉庫(repository),鏡像(image),容器(container)三者相互轉換。 1、鏡像(image) 鏡像&#xff1a;組成docker容器的基礎.類似安裝系統的鏡像 docker pull tomcat 通過pull來下載tomcat docker push XXXX 通過push的方式發布鏡像 2、容器(container)…

seaborn添加數據標簽_常見Seaborn圖的數據標簽快速指南

seaborn添加數據標簽In the course of my data exploration adventures, I find myself looking at such plots (below), which is great for observing trend but it makes it difficult to make out where and what each data point is.在進行數據探索的過程中&#xff0c;我…

使用python pandas dataframe學習數據分析

?? Note — This post is a part of Learning data analysis with python series. If you haven’t read the first post, some of the content won’t make sense. Check it out here.Note? 注意 -這篇文章是使用python系列學習數據分析的一部分。 如果您還沒有閱讀第一篇文…

實現TcpIp簡單傳送

private void timer1_Tick(object sender, EventArgs e) { IPAddress ipstr IPAddress.Parse("192.168.0.106"); TcpListener serverListener new TcpListener(ipstr,13);//創建TcpListener對象實例 ser…

SQLServer之函數簡介

用戶定義函數定義 與編程語言中的函數類似&#xff0c;SQL Server 用戶定義函數是接受參數、執行操作&#xff08;例如復雜計算&#xff09;并將操作結果以值的形式返回的例程。 返回值可以是單個標量值或結果集。 用戶定義函數準則 在函數中&#xff0c;將會區別處理導致語句被…

無向圖g的鄰接矩陣一定是_矩陣是圖

無向圖g的鄰接矩陣一定是To study structure,tear away all flesh soonly the bone shows.要研究結構&#xff0c;請盡快撕掉骨頭上所有的肉。 Linear algebra. Graph theory. If you are a data scientist, you have encountered both of these fields in your study or work …

移動pc常用Meta標簽

移動常用 <meta charset"UTF-8"><title>{$configInfos[store_title]}</title><meta content"widthdevice-width,minimum-scale1.0,maximum-scale1.0,shrink-to-fitno,user-scalableno,minimal-ui" name"viewport"><m…

前端繪制繪制圖表_繪制我的文學風景

前端繪制繪制圖表Back when I was a kid, I used to read A LOT of books. Then, over the last couple of years, movies and TV series somehow stole the thunder, and with it, my attention. I did read a few odd books here and there, but not with the same ferocity …

Rapi

本頁內容 ●引言●SMARTPHONE SDK API 庫●管理設備中的目錄文件●取系統信息●遠程操作電話和短信功能 Windows Mobile日益成熟&#xff0c;開發者隊伍也越來越壯大。作為一個10年的計算機熱愛者和程序員&#xff0c;我也經受不住新技術的誘惑&#xff0c;倒騰起Mobile這個玩具…

android 字符串特殊字符轉義

XML轉義字符 以下為XML標志符的數字和字符串轉義符 " ( 或 &quot;) ( 或 &apos;) & ( 或 &amp;) lt(<) (< 或 <) gt(>) (> 或 >) 如題&#xff1a; 比如&#xff1a;在string.xml中定義如下一個字符串&#xff0c;…