日期:2014-05-17 浏览次数:20849 次
while (!sr.EndOfStream)
{
string aline= sr.ReadLine().Trim();//一行一行读取
string[] list = aline.Split(',');
string insertlist = "'" + a[1] + "','" + a[2]+"','";
for (int i = 0; i < list.Length; i++)
{
insertlist += list[i] + "','";
}
insertlist += list[0]+a[1]+"'";
richTextBox1.Text = insertlist;
string strsql = "INSERT INTO `allwin`.`index_base` (`Symbolname`, `Symboltype`,`date`, `oprice`, `hprice`, `lpirce`, `cpirce`, `vol`, `openint`, `opricevariation`, `hpricevariation`, `lpircevariation`, `cpircevariation`, `symindex`) VALUES (" + insertlist + ")";
MySqlCommand cmd = new MySqlCommand(strsql,conn);
label2.Text = strsql;
try
{
cmd.ExecuteNonQuery();
}
catch
{
}
&n