hello every one
                i wont to select the data place in textbox in the form but the code does not work

    Sub backup()
                con.Open()
                    Dim cmd As New SqlCommand("BACKUP DATABASE ['" & TextBox1.Text & "'] TO DISK = N'D:\5-2016\Backup.bak' WITH COPY_ONLY", con)
                cmd.ExecuteNonQuery()
                con.Close()

Wait, did you post that 4 times?

commented: Yes, but I just deleted 3 of them. +14

hi,

Put the body of your method in a "Try .... Catch" block. Solve your problem following the generated exception or show us this exception !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.