CODE
CODE
CODE
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
static string conString = "Data Source=(LocalDB)\\
MSSQLLocalDB;AttachDbFilename=c:\\users\\student.desktop-05rcfoa.000\\documents\\
visual studio 2015\\Projects\\WindowsFormsApplication6\\WindowsFormsApplication6\\
Database1.mdf;Integrated Security=True";
SqlConnection con = new SqlConnection(conString);
public Form1()
{
InitializeComponent();
}
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
while (reader.Read())
{
listBox1.Items.Add(reader[0]);
listBox2.Items.Add(reader[1]);
listBox3.Items.Add(reader[2]);
}
con.Close();
}