Quote:
Originally Posted by Njahs
Probier es mit einem doppelten Backslash.
(  )
Grüße
|
Danke für die Antwort
ich bin aber eher noch recht beu in sachen c#
vielleicht könnte mir das jemand an hand hier von erklären bitte ?
ich blick da gerade 0 durch :/
Code:
private void button27_Click_1(object sender, EventArgs e)
{
StreamReader sw = null;
try
{
sw = new StreamReader(Path.Combine(Application.StartupPath + @"\config.ini"));
Host_txt.Text = sw.ReadLine();
user_txt.Text = sw.ReadLine();
paswd_txt.Text = sw.ReadLine();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
sw.Close();
}
this.timer1.Start();
string constring = "datasource=" + Host_txt.Text + ";port=3306;username=" + user_txt.Text + ";password=" + paswd_txt.Text;
MySqlConnection conDataBase = new MySqlConnection(constring);
MySqlCommand cmdDataBase = new MySqlCommand("select a_index,a_file_smc from newproject_data.t_item ;", conDataBase);
try
{
MySqlDataAdapter sda = new MySqlDataAdapter();
sda.SelectCommand = cmdDataBase;
DataTable dbdataset = new DataTable();
sda.Fill(dbdataset);
BindingSource bSource = new BindingSource();
bSource.DataSource = dbdataset;
dataGridView5.DataSource = bSource;
sda.Update(dbdataset);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void button28_Click(object sender, EventArgs e)
{
string constring = "datasource=" + Host_txt.Text + ";port=3306;username=" + user_txt.Text + ";password=" + paswd_txt.Text;
string Query = "insert into newproject_data.t_item (a_index,a_file_smc) values('" + this.textBox120.Text + "','" + this.textBox119.Text + "') ;";
MySqlConnection conDataBase = new MySqlConnection(constring);
MySqlCommand cmdDataBase = new MySqlCommand(Query, conDataBase);
MySqlDataReader myReader;
try
{
conDataBase.Open();
myReader = cmdDataBase.ExecuteReader();
MessageBox.Show("Saved");
while (myReader.Read())
{
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
so soll es sein nach insert : Data\Item\Common\ITEM_treasure02.smc
und so ist es leider : DataItemCommonITEM_treasure02.smc