Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
GeneralRe: Generic Type and new() Pin
Mycroft Holmes10-Oct-09 12:23
professionalMycroft Holmes10-Oct-09 12:23 
Questionmouse over form border event problem Pin
faith4ever4u9-Oct-09 12:05
faith4ever4u9-Oct-09 12:05 
AnswerRe: mouse over form border event problem Pin
Dave Kreskowiak9-Oct-09 12:21
mveDave Kreskowiak9-Oct-09 12:21 
Answerflame Pin
Luc Pattyn9-Oct-09 12:42
sitebuilderLuc Pattyn9-Oct-09 12:42 
QuestionHow to use C+++ ATL template calss in C# Pin
Chiman19-Oct-09 10:58
Chiman19-Oct-09 10:58 
AnswerRe: How to use C+++ ATL template calss in C# Pin
Dave Kreskowiak10-Oct-09 3:16
mveDave Kreskowiak10-Oct-09 3:16 
QuestionInvoking Progressbar Pin
SimpleData9-Oct-09 10:11
SimpleData9-Oct-09 10:11 
AnswerRe: Invoking Progressbar Pin
Luc Pattyn9-Oct-09 10:13
sitebuilderLuc Pattyn9-Oct-09 10:13 
GeneralRe: Invoking Progressbar Pin
SimpleData9-Oct-09 10:49
SimpleData9-Oct-09 10:49 
GeneralRe: Invoking Progressbar Pin
Luc Pattyn9-Oct-09 10:56
sitebuilderLuc Pattyn9-Oct-09 10:56 
GeneralRe: Invoking Progressbar Pin
SimpleData9-Oct-09 22:31
SimpleData9-Oct-09 22:31 
GeneralRe: Invoking Progressbar Pin
DaveyM6910-Oct-09 0:42
professionalDaveyM6910-Oct-09 0:42 
GeneralRe: Invoking Progressbar Pin
SimpleData10-Oct-09 0:44
SimpleData10-Oct-09 0:44 
GeneralRe: Invoking Progressbar Pin
Luc Pattyn10-Oct-09 1:52
sitebuilderLuc Pattyn10-Oct-09 1:52 
AnswerRe: Invoking Progressbar Pin
Abhijit Jana9-Oct-09 10:35
professionalAbhijit Jana9-Oct-09 10:35 
Questionan exception with this code Pin
Mohamed El-Wehishy9-Oct-09 8:49
Mohamed El-Wehishy9-Oct-09 8:49 
AnswerRe: an exception with this code Pin
Not Active9-Oct-09 8:57
mentorNot Active9-Oct-09 8:57 
GeneralRe: an exception with this code Pin
Mohamed El-Wehishy9-Oct-09 9:09
Mohamed El-Wehishy9-Oct-09 9:09 
ok man this is my code

private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection cn = new SqlConnection("initial catalog=vvvvvvvvvvv;server=.;integrated security=sspi");
                SqlCommand cmd = new SqlCommand("back_up_database", cn);
                cmd.CommandType = CommandType.StoredProcedure;

                cn.Open();

                int i = cmd.ExecuteNonQuery();

                cn.Close();



                if (i > 0)
                {
                    MessageBox.Show("Your database is backed up");
                }
            }
            catch(Exception ex)
            {
                MessageBox.Show("Sorry we can not back up your database");
            }
        }


when i run this code it throw exception
but when i execute the stored procedure

ALTER proc [dbo].[back_up_database]
as
ALTER DATABASE [vvvvvvvvvvv]
SET OFFLINE
go
BACKUP DATABASE [vvvvvvvvvvv]
TO DISK = 'D:\SQLServerBackups\vvvvvvvvvvv.Bak'
with NO_COMPRESSION
go
ALTER DATABASE [vvvvvvvvvvv]
SET ONLINE
go


it completed successfully

so what is wrong

thanks for your interest

Mohamed El-Wehishy
GeneralRe: an exception with this code Pin
Not Active9-Oct-09 9:33
mentorNot Active9-Oct-09 9:33 
GeneralRe: the exception Pin
Luc Pattyn9-Oct-09 10:01
sitebuilderLuc Pattyn9-Oct-09 10:01 
GeneralRe: the exception Pin
Mohamed El-Wehishy9-Oct-09 10:11
Mohamed El-Wehishy9-Oct-09 10:11 
GeneralRe: the exception Pin
Not Active9-Oct-09 10:31
mentorNot Active9-Oct-09 10:31 
GeneralRe: the exception Pin
Not Active9-Oct-09 10:35
mentorNot Active9-Oct-09 10:35 
GeneralRe: the exception Pin
Luc Pattyn9-Oct-09 11:13
sitebuilderLuc Pattyn9-Oct-09 11:13 
AnswerRe: an exception with this code Pin
EliottA9-Oct-09 9:01
EliottA9-Oct-09 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.