当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteDatabase.Insert方法代码示例

本文整理汇总了C#中SQLiteDatabase.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteDatabase.Insert方法的具体用法?C# SQLiteDatabase.Insert怎么用?C# SQLiteDatabase.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SQLiteDatabase的用法示例。


在下文中一共展示了SQLiteDatabase.Insert方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddNewJoke

        public void AddNewJoke(string message)
        {
            //Create sanitised string with the joke
            List<string> strings = new List<string>(message.Split(' '));
            strings.RemoveAt(0);
            string joke = String.Join(" ", strings.ToArray());
            joke = System.Text.RegularExpressions.Regex.Escape(joke.Replace("'", @"''")) ;

            SQLiteDatabase db = new SQLiteDatabase();
            Dictionary<String, String> data = new Dictionary<String, String>();
            data.Add("JokeBody", joke);
            try
            {
                db.Insert("Jokes", data);
            }
            catch (Exception crap)
            {
                Logger.GetLogger().Error(crap.Message);
            }
        }
开发者ID:nukeop,项目名称:SteamRelayBot,代码行数:20,代码来源:AddJoke.cs

示例2: AddNewTrivia

        public void AddNewTrivia(string message, string author)
        {
            //Create a sanitised string with trivia
            List<string> strings = new List<string>(message.Split(' '));
            strings.RemoveAt(0);
            string trivia = String.Join(" ", strings.ToArray());
            trivia = System.Text.RegularExpressions.Regex.Escape(trivia.Replace("'", @"''"));

            SQLiteDatabase db = new SQLiteDatabase();
            Dictionary<String, String> data = new Dictionary<String, String>();
            data.Add("Body", trivia);
            data.Add("Author", author);

            try
            {
                db.Insert("Trivia", data);
            }
            catch (Exception crap)
            {
                Logger.GetLogger().Error(crap.Message);
            }
        }
开发者ID:nukeop,项目名称:SteamRelayBot,代码行数:22,代码来源:AddTrivia.cs

示例3: insert_

        public void insert_(ProgramSettings program_settings, String template_name)
        {
            db = new SQLiteDatabase();
            Dictionary<String, String> data = new Dictionary<String, String>();
            data.Add("f_max", program_settings.f_max.ToString());
            data.Add("template_name", template_name);
            data.Add("t_increase", program_settings.time_incr.ToString());
            data.Add("time_pause", program_settings.t_pause.ToString());
            data.Add("number_of_attempts", program_settings.num_of_attempts.ToString());
            data.Add("allow_digit", program_settings.digitization.ToString());
            data.Add("allow_auto_calculate", program_settings.calculation.ToString());

            data.Add("template_color_num", program_settings.template_color_num.ToString());
            data.Add("template_line_width", program_settings.template_line_width.ToString());
            data.Add("measurement_color_num", program_settings.measurement_color_num.ToString());
            data.Add("measurement_line_width", program_settings.measurement_line_width.ToString());
            data.Add("grid_color_num", program_settings.grid_color_num.ToString());
            data.Add("grid_line_width", program_settings.grid_line_width.ToString());
            data.Add("axis_color_num", program_settings.axis_color_num.ToString());
            data.Add("axis_line_width", program_settings.axis_line_width.ToString());

            try
            {
                db.Insert("settings", data);
            }
            catch (Exception crap)
            {
                MessageBox.Show(crap.Message);
            }
        }
开发者ID:K0lyuchiy,项目名称:Tass,代码行数:30,代码来源:tassDB.cs

示例4: SaveMeasuringToSQLite

 public void SaveMeasuringToSQLite(string prefix, string numOfTemplate, string number, string lbs)
 {
     // Сохранение результатов измерений
     db = new SQLiteDatabase();
     Dictionary<String, String> data = new Dictionary<String, String>();
     //data.Add("num_of_measurement", "1");
     data.Add("name_of_measurement ", prefix);
     data.Add("num_of_settings_template ", numOfTemplate);
     data.Add("date", DateTime.Now.ToString());
     data.Add("path", lbs + prefix + "_" + number + ".xls");
     try
     {
         db.Insert("measurement_results", data);
     }
     catch (Exception crap)
     {
         MessageBox.Show(crap.Message);
     }
 }
开发者ID:K0lyuchiy,项目名称:Tass,代码行数:19,代码来源:tassDB.cs

示例5: button_Click

 private void button_Click(object sender, RoutedEventArgs e)
 {
     var db = new SQLiteDatabase();
     Dictionary<String, String> data = new Dictionary<String, String>();
     data.Add("NAME", nameTextBox.Text);
     data.Add("CLIP", clipBoardTB.Text);
     try
     {
         db.Insert("clipboard", data);
     }
     catch (Exception crap)
     {
         MessageBox.Show(crap.Message);
     }
 }
开发者ID:adamk8875,项目名称:Work-console,代码行数:15,代码来源:itempage1.xaml.cs

示例6: TestSQLiteDBInsert

 public void TestSQLiteDBInsert()
 {
     db = new SQLiteDatabase();
     Dictionary<string, string> data = new Dictionary<string, string>();
     data.Add("id", "3");
     data.Add("name", "Blue");
     data.Add("hex", "0000ff");
     try
     {
         db.Insert("colors", data);
     }
     catch (Exception ex)
     {
         Console.Write("Error: {0}", ex.Message);
     }
 }
开发者ID:parinya-chav,项目名称:DevicesSimulation,代码行数:16,代码来源:SQLiteInfra.cs


注:本文中的SQLiteDatabase.Insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。