I am busy with a project, it is going to consist out of 3 different windows which is logic enough for this whole code to be interactive.
It must be able to pull data into a windows form, displaying it into a textbox, and when you click on the textbox it needs to open up another window where you will have a windows form that will display data as the code loops through the questions in the database.
I am not sure how to push the data that has been selected on the database to the next window...I will show you now with the pics what I am trying to do, I know this is very confusing...
Here is my code for the first window:
Here is my code for the next window it needs to open:
With the second window the data in the table needs to be displayed and each row from the table needs to have a checkbox next to them, so that if the check box is checked, the relevant information of the checked row will show up in the 3rd window... so MY question is, HOW do I pull that data from that specific database and let it show in the listcheckbox?
It must be able to pull data into a windows form, displaying it into a textbox, and when you click on the textbox it needs to open up another window where you will have a windows form that will display data as the code loops through the questions in the database.
I am not sure how to push the data that has been selected on the database to the next window...I will show you now with the pics what I am trying to do, I know this is very confusing...
Here is my code for the first window:
Code:
;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
//SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=KnowledgeEssentials;Integrated Security=SSPI");
//int intType = 0;
public Form1()
{
InitializeComponent();
}
private void NetworkRdBtn_CheckedChanged(object sender, EventArgs e)
{
//SqlCommand command = new
//SqlCommand("SELECT * FROM SectionT WHERE ID = 2");
if (NetworkRdBtn.Checked == true)
{
Frmknowledge lfrm = new Frmknowledge(2);
lfrm.Show();
}
else
{
}
}
private void HardwareRdBtn_CheckedChanged(object sender, EventArgs e)
{
//SqlCommand command = new
//SqlCommand("SELECT * FROM SectionT WHERE ID = 1");
if (HardwareRdBtn.Checked == true)
{
Frmknowledge lfrm = new Frmknowledge(1);
lfrm.Show();
}
else
{
}
}
private void ServerRdBtn_CheckedChanged(object sender, EventArgs e)
{
//SqlCommand command = new
//SqlCommand("SELECT * FROM SectionT WHERE ID = 3");
if (ServerRdBtn.Checked == true)
{
Frmknowledge lfrm = new Frmknowledge(3);
lfrm.Show();
}
else
{
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Code:
namespace WindowsFormsApplication1
{
public partial class Frmknowledge : Form
{
int mint = 0;
public Frmknowledge(int pint)
{
mint = pint;
InitializeComponent();
}
private void Frmknowledge_Load(object sender, EventArgs e)
{
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
Comment