leDbConnection con = new OleDbConnection(); DataTable dt = new DataTable(); con.ConnectionString = "Provider=MSDAORA;Data Source=DATA;Password=**********;User ID=********"; con.Open(); string sqlcommand = "INSERT INTO GROUPS(GROUP_ID, GROUP_NAME,DEPT_ID) " + "VALUES(SEQ_MAX_GROUP_ID_NO.NEXTVAL,@groupName, SELECT DEPT_ID FROM PERSONNEL_TEMP.DEPARTMENT WHERE DEPARTMENT_NAME=@depName)"; OleDbCommand command = new OleDbCommand(sqlcommand, con); command.Parameters.AddWithValue("@groupName", textBox1.Text); command.Parameters.AddWithValue("@depName", comboBox1.SelectedItem); OleDbDataAdapter oda = new OleDbDataAdapter(command); oda.Fill(dt); dataGridView2.DataSource = dt; con.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)