Cenk Isik

Cenk Isik

  • NA
  • 44
  • 30.5k

Asp.Net Sql Select Query dropdown parameters error

Jul 16 2012 8:08 AM
Hi ,


int selected = drpDownYayinNoktalari.SelectedIndex;
        cnn = connect.GetConnection();
        sorgu = "SELECT dbo.YAYIN_NOKTALARI.YAYIN_NOKTASI_ADI, dbo.YAYIN_NOKTALARI.YETKILI_KISI, dbo.YAYIN_NOKTALARI.IL, dbo.YAYIN_NOKTALARI.ADRES,dbo.YAYIN_NOKTALARI.TEL, dbo.PC_OZELLIKLERI.YAYIN_NOKTASI_NO, dbo.PC_OZELLIKLERI.PC_SERI_NO, dbo.PC_OZELLIKLERI.RAM,dbo.PC_OZELLIKLERI.CPU, dbo.PC_OZELLIKLERI.EKRAN_BELLEK, dbo.PC_OZELLIKLERI.OS, dbo.PC_OZELLIKLERI.CODEC, dbo.PC_OZELLIKLERI.TEAM_ID,dbo.PC_OZELLIKLERI.ACIKLAMA, dbo.YAYIN_NOKTALARI.MECRA_TIPI, dbo.MECRALAR.MECRA_ADI" +
                "FROM dbo.PC_OZELLIKLERI INNER JOIN" +
                      "dbo.YAYIN_NOKTALARI ON dbo.PC_OZELLIKLERI.YAYIN_NOKTASI_ID = dbo.YAYIN_NOKTALARI.YAYIN_NOKTASI_ID INNER JOIN " +
                      "dbo.MECRALAR ON dbo.YAYIN_NOKTALARI.YAYIN_NOKTASI_ID = dbo.MECRALAR.ID WHERE PC_OZELLIKLERI.YAYIN_NOKTASI_ID =  ' " + selected + " ' ";
        dataAdapter = new SqlDataAdapter(sorgu,cnn);
       
        dSet = new DataSet();
        dataAdapter.Fill(dSet);
        grdIslemler.DataSource = dSet.Tables[0];
        grdIslemler.DataBind();


I get the error Incorrect syntax near '.'.
I try many ways for the solution but they didnt work. please help me.

Answers (2)