int [] a={2,5,6,22,25,30};
float [] b={1.22 ,1.45 ,5.789 ,3.4 ,9.022,3.78};
sqlconnection cn = new sqlconnection( "连接字符串");
sqlcommand cmd = cn.createcommand();
for(int i=0 ; i<6;i++)
{
cmd.commandtext="insert into table_表名(列名1,列名2) values(" + a[i].toString() + "," +b[i].toString() + ")" ;
cmd.ExecuteNonQuery();
}
cn.close();
把分给一楼吧
楼主太弱了吧 错误是你没有把连接字符串 替换成你的数据库连接