日本好好热aⅴ|国产99视频精品免费观看|日本成人aV在线|久热香蕉国产在线

  • <cite id="ikgdy"><table id="ikgdy"></table></cite>
    1. 西西軟件園多重安全檢測下載網(wǎng)站、值得信賴的軟件下載站!
      軟件
      軟件
      文章
      搜索

      首頁編程開發(fā)C#.NET → C# SQLite Windows Mobile 數(shù)據(jù)庫手機技術(shù)開發(fā)

      C# SQLite Windows Mobile 數(shù)據(jù)庫手機技術(shù)開發(fā)

      相關(guān)軟件相關(guān)文章發(fā)表評論 來源:本站整理時間:2010/7/20 13:47:27字體大。A-A+

      作者:佚名點擊:930次評論:0次標簽: WindowsMobile

      • 類型:PPC|WM平臺大。322KB語言:中文 評分:6.6
      • 標簽:
      立即下載

      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.SqlClient;

      using System.Data.SqlServerCe;

      using System.Net;

      using System.IO;

      namespace WinAppGrid

      {

      public partial class Form1 : Form

      {

      public Form1()

      {

      InitializeComponent();

      }

      //創(chuàng)建數(shù)據(jù)庫的表

      private Boolean CreateTable()

      {

      try

      {

      SqlCeConnection myconn = new SqlCeConnection("DataSource=mysdf.sdf");

      SqlCeCommand com = new SqlCeCommand("create table PC (PCNO NVarChar(10) primary key,XH NVarChar(10) NOT NULL,WERKS NVarChar(4) NOT NULL,PC_DATE NVarChar(10))");

      myconn.Open();

      com.Connection = myconn;

      com.ExecuteNonQuery();

      myconn.Close();

      MessageBox.Show("創(chuàng)建數(shù)據(jù)庫成功!");

      return true;

      }

      catch (Exception ex)

      {

      MessageBox.Show("創(chuàng)建數(shù)據(jù)庫失敗" + ex.ToString().Substring(1, 60));

      return false;

      }

       

       

       

      }

      private void button1_Click(object sender, EventArgs e)

      {

      //創(chuàng)建數(shù)據(jù)庫

      try

      {

      if ( File.Exists("mysdf.sdf"))

      {

      MessageBox.Show("數(shù)據(jù)庫已經(jīng)存在");

       

      }

      else

      {

      SqlCeEngine eng = new SqlCeEngine("DataSource=mysdf.sdf");

      eng.CreateDatabase();

      eng.Dispose();

      MessageBox.Show("創(chuàng)建數(shù)據(jù)庫成功");

       

        

      }

      Boolean rtu;

      rtu = CreateTable();

      if (rtu = false)

      {

      MessageBox.Show("數(shù)據(jù)表已經(jīng)存在!");

      }

      else

      {

      MessageBox.Show("創(chuàng)建數(shù)據(jù)表成功!");

       

       

      }

       

      }

      catch(Exception ex)

      {

      MessageBox.Show("創(chuàng)建數(shù)據(jù)庫失敗"+ ex.ToString().Substring(1,60));

       

      }

       

      }

      }
       

        相關(guān)評論

        閱讀本文后您有什么感想? 已有人給出評價!

        • 8 喜歡喜歡
        • 3 頂
        • 1 難過難過
        • 5 囧
        • 3 圍觀圍觀
        • 2 無聊無聊

        熱門評論

        最新評論

        第 1 樓 山東青島電信ADSL 網(wǎng)友 客人 發(fā)表于: 2010/9/13 17:43:13
        有毛病吧,這是sqlite?

        支持( 0 ) 蓋樓(回復)

        發(fā)表評論 查看所有評論(0)

        昵稱:
        表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
        字數(shù): 0/500 (您的評論需要經(jīng)過審核才能顯示)