wxy新人小白 2019-08-30 17:13 采纳率: 31.3%
浏览 2915
已采纳

(我原来问的不小心给删了)sql语句SQL logic error near ",": syntax error一般错误出在哪里

想达到的效果:主窗口上面是一个容器panel,里面有3个下拉框,左边是一个toolStrip菜单栏,剩余部分是一个panel1(用来显示五个子窗口),如第一个图;按完第一个按钮,在主窗口的panel1上显示第一个子窗口(Win1)的内容,效果如图二;
a是comboBox1.Text,b 是comboBox2.Text,c是comboBox3.Text,为了方便子窗口调用主窗口public static string a; public static string b;public static string c;有令string e = Form1.a; string f = Form1.b;
string g = Form1.c;不知道对不对

下面是主窗口用的部分程序

public static string a; public static string b;public static string c;Win1 w1; w1 = new Win1();string a = comboBox1.Text; string b = comboBox2.Text; string c = comboBox3.Text;
  private void toolStripButton1_Click(object sender, EventArgs e)
        {
           this.panel1.Controls.Clear();  // 清空原有的控件
            w1.TopLevel = false;  // 非顶级窗口
            w1.FormBorderStyle = FormBorderStyle.None;  // 不显示标题栏
            //w1.Dock = System.Windows.Forms.DockStyle.Fill;  // 填充panel
            w1.WindowState = FormWindowState.Maximized;
            this.panel1.Controls.Add(w1);  // 添加w1窗体
            //w1.Show(this);
            w1.Show();
            flag = true;
        }
                 private void button1_Click(object sender, EventArgs e)
        {
            if (flag == true && flag1 == true && flag2 == true)
            {
                w1.Creatchart1();

            }
        }

下面是Win1的其中的一个chart的程序

private void Creatchart1()
        {
            string e = Form1.a;
            string f = Form1.b;
            string g = Form1.c;
            string wax = e + f + g;
            string dbPath = @"D:\历年高考分数.db";
            string sq = @"Data Source=" + dbPath;
            m = new SQLiteConnection(sq);
            m.Open();
            SQLiteDataAdapter mAdapter = new SQLiteDataAdapter("select " + wax + ",yxlc from 表2", m);
            DataSet ds = new DataSet();
            mAdapter.Fill(ds);
            DataTable dt = ds.Tables[0];
            Series Series1 = new Series();
            chart1.DataSource = dt;
            Series1.IsValueShownAsLabel = false;//是否显示图例
            chart1.Series.Add(Series1);
            chart1.Series["Series1"].ChartType = SeriesChartType.Spline;//形状
            chart1.Series[0].XValueMember = "yxlc";//X轴数据成员列
            chart1.Series[0].YValueMembers = wax;
            chart1.Series[0].IsValueShownAsLabel = true;//显示坐标
            chart1.DataBind();
            chart1.BringToFront();
            m.Close();
                        }

启动时在mAdapter.Fill(ds);处显示其他信息: SQL logic error near ",": syntax error
,应该怎么改
图片说明图片说明

  • 写回答

3条回答 默认 最新

  • wxy新人小白 2019-09-09 11:20
    关注

    private void button1_Click(object sender, EventArgs e)
    {
    if (flag == true && flag1 == true && flag2 == true)
    {
    string wax = comboBox1.Text + comboBox2.Text + comboBox3.Text;
    w1.Creatchart1(wax);
    }
    }
    public void Creatchart1(string wax)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。