What is wrong in my this backup code? sql C#

Featured Imgs 23

Hi
What is wrong in my this backup code it always not working and gives me an error

 SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;
                                     AttachDbFilename=D:\repos\mysales\WindowsFormsApp4\Database1.mdf;
                                     Integrated Security=True;
                                     ");
 string database = con.Database.ToString();
 if (textBox1.Text == "") 
 {
     MessageBox.Show("Please Enter Backup File Location");
 }
 else
 {
     string cmd = "BACKUP DATABASE [" + database +"] To DISK = '"+ textBox1 .Text + " \\ " +"database"+"-"+ DateTime .Now .ToString ("yyyy-MM-dd--HH-mm-ss") +".bak'";
     con.Open();
     SqlCommand  command=new SqlCommand(cmd, con);
     command.ExecuteNonQuery();
     MessageBox.Show("Database Backup Done Seccessfully.");
     con.Close();
     button2.Enabled = false;
 }

Celebrating the Trailblazers: International Women in Engineering Day 2024

Featured Imgs 23

As we approach International Women in Engineering Day on June 23, 2024, we must recognize women's remarkable achievements and invaluable contributions to engineering. 

This global awareness campaign, celebrated annually, aims to highlight the accomplishments of women engineers and encourage more women to pursue careers in this dynamic and impactful industry. In this article, we bring together the insights and experiences of several exceptional women in technology who share their thoughts on the significance of this day and the importance of promoting diversity in the tech industry.