.Hello guys! I would like to ask for some help regarding one of my class projects.
Here i have two classes named AddBook.cs and the other is ListCommand.cs, what i want to do is to transfer certain codes from AddBook to ListCommand so that whenever i want to use the codes i'm only going to call the class ListCommand to avoid writing the codes again.
Here are the codes that i want to store on ListCommand.cs:
SqlCommand comm1 = new SqlCommand("SELECT Authors_Name FROM Author", SQLcon.conn);
SqlDataAdapter da1 = new SqlDataAdapter(comm1);
DataSet ds1 = new DataSet();
da1.Fill(ds1);
checkedListBox1.DataSource = ds1.Tables[0];
checkedListBox1.DisplayMember = "Authors_Name";
checkedListBox1.ValueMember = "Authors_Name";
Thank you to those who can help!