本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}