Две струны когда-нибудь с#
У меня есть две струны
Нет никакого результата
Что я уже пробовал:
String 1 = "select id from dbo.normativi_lista where name="+ nametextbox.tex
String 2="select * from dbo.normativi_roba where id_fakture=" + String1 <pre> PullData(); using (SqlConnection openCon = new SqlConnection(con)) { String selectid = "select id from dbo.normativi_lista where naziv= " + nazivTextBox.Text; String saveStaff = "SELECT id, redni_broj as 'R.b.', sifra as 'Šifra', naziv as 'Naziv', proizvodjac as 'Proizvođač', jedinica_mjere as 'J.M.'," + "kolicina as 'Količina', prosjecna_nab_cijena as 'Pr. Nab. Cij.', iznos as 'Iznos' from dbo.normativi_roba where id_fakture=" + selectid; Console.WriteLine(saveStaff); openCon.Open(); using (SqlDataAdapter querySaveStaff = new SqlDataAdapter(saveStaff, con)) { DataTable dt = new DataTable(); querySaveStaff.Fill(dt); NormativRobaDataGridView.DataSource = dt; NormativRobaDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; NormativRobaDataGridView.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; NormativRobaDataGridView.Columns["id"].Visible = false; NormativRobaDataGridView.Columns["R.b."].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; NormativRobaDataGridView.Columns["R.b."].Width = 80; NormativRobaDataGridView.Columns["Šifra"].Width = 100; NormativRobaDataGridView.Columns["Naziv"].MinimumWidth = 280; NormativRobaDataGridView.Columns["Naziv"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; NormativRobaDataGridView.Columns["Proizvođač"].Width = 150; NormativRobaDataGridView.Columns["J.M."].Width = 130; NormativRobaDataGridView.Columns["Količina"].Width = 150; NormativRobaDataGridView.Columns["Pr. Nab. Cij."].Width = 150; NormativRobaDataGridView.Columns["Iznos"].Width = 150; NormativRobaDataGridView.Update(); NormativRobaDataGridView.Refresh(); //countRowsLabel.Text = "Ukupno normativa: " + NormativListaDataGridView.RowCount.ToString(); //countRowsLabel2.Text = "Ukupno stavki: " + NormativRobaDataGridView.RowCount.ToString(); this.NormativRobaDataGridView.Sort(this.NormativRobaDataGridView.Columns["R.b."], ListSortDirection.Ascending); //double[] columnData4 = new double[NormativRobaDataGridView.Rows.Count]; //columnData4 = (from DataGridViewRow row in NormativRobaDataGridView.Rows // where row.Cells["Iznos"].FormattedValue.ToString() != string.Empty // select Convert.ToDouble(row.Cells["Iznos"].FormattedValue)).ToArray(); //UkupnoLabel.Text = columnData4.Sum().ToString("#,0.00"); } }