Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class BookVariables
- {
- public static string BookName ="";
- public static string BookGenre = "";
- public static string BookAuthor = "";
- public static char Hallway = '\0';
- public static int BookClass = 3;
- public static char shelf = '\0';
- public static int CopiesNo = 0;
- public static string ISBN = "";
- public static void clear()
- {
- BookGenre = "";
- BookName = "";
- BookAuthor = "";
- Hallway = '\0';
- BookClass = 3;
- shelf = '\0';
- CopiesNo = 0;
- ISBN = "";
- }
- }
- private void Save_Click_1(object sender, EventArgs e)
- {
- SqlConnection con = new SqlConnection("Data Source=DESKTOP-FH9M09N\\ANANSQLSERVER;Initial Catalog=UniLibrary;Integrated Security=True");
- SqlCommand sqlCommand = new SqlCommand("insert into Book Values('" +1 + "','" + BookVariables.BookName
- + "','" + BookVariables.BookAuthor + "','"+BookVariables.BookGenre + "','"+BookVariables.BookClass + "','"
- +BookVariables.shelf + "','"+BookVariables.Hallway + "','"+BookVariables.ISBN + "','"+
- BookVariables.CopiesNo+"')",con);
- sqlCommand.Connection = con;
- con.Open();
- sqlCommand.ExecuteNonQuery();
- con.Close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement