Click here to Skip to main content
15,887,485 members
Home / Discussions / Database
   

Database

 
AnswerRe: Problem with Datepart Pin
David Skelly12-Nov-09 5:42
David Skelly12-Nov-09 5:42 
GeneralRe: Problem with Datepart Pin
Vimalsoft(Pty) Ltd12-Nov-09 22:52
professionalVimalsoft(Pty) Ltd12-Nov-09 22:52 
QuestionChanging a column to IDENTITY Pin
garfield18511-Nov-09 22:34
garfield18511-Nov-09 22:34 
AnswerRe: Changing a column to IDENTITY Pin
Niladri_Biswas12-Nov-09 1:16
Niladri_Biswas12-Nov-09 1:16 
GeneralRe: Changing a column to IDENTITY Pin
garfield18512-Nov-09 2:41
garfield18512-Nov-09 2:41 
GeneralRe: Changing a column to IDENTITY Pin
WoutL12-Nov-09 3:05
WoutL12-Nov-09 3:05 
GeneralRe: Changing a column to IDENTITY Pin
Niladri_Biswas12-Nov-09 3:22
Niladri_Biswas12-Nov-09 3:22 
QuestionSqlConnection or what??????? i need help Pin
Mohamed El-Wehishy11-Nov-09 9:36
Mohamed El-Wehishy11-Nov-09 9:36 
high guys
i have a problem
when i press F5 on visual studio to start debugging of my project, it runs good no errors
but
when i press ctrl+F5 on visual studio to start without debugging of my project,it gets error message
the error message is:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immedediately.
the type initializer for 'System.Data.SqlClient.SqlConnection'threw an exception.
Details..
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlConnection' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlConnectionFactory' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. ---> System.PlatformNotSupportedException: This operation is only supported on Windows 2000 SP3 or later operating systems.
at System.Security.Principal.SecurityIdentifier..ctor(WellKnownSidType sidType, SecurityIdentifier domainSid)
at System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(String mutexName, Mutex& mutex)
at System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName, String instanceName, Boolean enableReuse, PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime)
at System.Diagnostics.PerformanceCounter.Initialize()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at System.Data.ProviderBase.DbConnectionPoolCounters.Counter..ctor(String categoryName, String instanceName, String counterName, PerformanceCounterType counterType)
at System.Data.ProviderBase.DbConnectionPoolCounters..ctor(String categoryName, String categoryHelp)
at System.Data.SqlClient.SqlPerformanceCounters..ctor()
at System.Data.SqlClient.SqlPerformanceCounters..cctor()
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnectionFactory..cctor()
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection..cctor()
--- End of inner exception stack trace ---
at System.Data.SqlClient.SqlConnection..ctor()
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Computer_Sales_System.Form2.button1_Click(Object sender, EventArgs e) in D:\My first project\Computer Sales System\Computer Sales System\Form2.cs:line 178
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Computer Sales System
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/My%20first%20project/Computer%20Sales%20System/Computer%20Sales%20System/bin/Debug/Computer%20Sales%20System.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
PresentationCore
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.1500 built by: QFE
CodeBase: file:///C:/Windows/assembly/GAC_32/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
WindowsBase
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.1500 built by: QFE
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
WindowsFormsIntegration
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.1500 built by: QFE
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsFormsIntegration/3.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
PresentationFramework
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.1500 built by: QFE
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
PresentationFramework.Aero
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.1500 built by: QFE
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework.Aero/3.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
----------------------------------------
System.Management
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3074 (QFE.050727-3000)
CodeBase: file:///C:/Windows/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



the code is:


SqlConnection cn = new SqlConnection(@"Data Source='MOHAMEDEWEHISHY\SQLEXPRESS';Initial Catalog='Computer Sales System';integrated security=sspi");
try
{
SqlCommand cmd = new SqlCommand("backup_database", cn);
cmd.CommandType = CommandType.StoredProcedure;

if (System.IO.File.Exists(@"D:\SQLServerBackups\Computer Sales System.bak"))
{
System.IO.File.Delete(@"D:\SQLServerBackups\Computer Sales System.bak");
}

cn.Open();
int i = cmd.ExecuteNonQuery();

if (i < 0)
{
MessageBox.Show("Your database is backed up successfully");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
MessageBox.Show("Sorry ... You can not back up your database");
}
finally
{
cn.Close();
}


so the problem is using SqlConnection with others not DML commands
i tried to use OLEDBConnection but it not gets result


So what is the solution????????

Thanks,
Mohamed El-Wehishy
NewsFree Online SQL Server 2008 R2 Developer Training Available on MSDEV Pin
brucedkyle11-Nov-09 5:56
brucedkyle11-Nov-09 5:56 
QuestionAdvice Needed - Regarding Data Transfer Between Databases On Seperate Servers [modified] Pin
It_tech11-Nov-09 4:36
It_tech11-Nov-09 4:36 
AnswerRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
_Damian S_11-Nov-09 13:34
professional_Damian S_11-Nov-09 13:34 
GeneralRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
It_tech12-Nov-09 0:44
It_tech12-Nov-09 0:44 
AnswerRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
Mycroft Holmes11-Nov-09 13:43
professionalMycroft Holmes11-Nov-09 13:43 
GeneralRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
It_tech12-Nov-09 0:39
It_tech12-Nov-09 0:39 
GeneralRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
Mycroft Holmes12-Nov-09 1:22
professionalMycroft Holmes12-Nov-09 1:22 
GeneralRe: Advice Needed - Regarding Data Transfer Between Databases On Seperate Servers Pin
It_tech12-Nov-09 4:12
It_tech12-Nov-09 4:12 
QuestionEfficient searching Pin
mjackson1111-Nov-09 3:28
mjackson1111-Nov-09 3:28 
AnswerRe: Efficient searching Pin
Covean11-Nov-09 5:02
Covean11-Nov-09 5:02 
AnswerRe: Efficient searching Pin
mjackson1111-Nov-09 8:19
mjackson1111-Nov-09 8:19 
AnswerRe: Efficient searching Pin
Mycroft Holmes11-Nov-09 13:51
professionalMycroft Holmes11-Nov-09 13:51 
Questionsql query Pin
creative7710-Nov-09 21:51
creative7710-Nov-09 21:51 
AnswerRe: sql query Pin
Niladri_Biswas11-Nov-09 1:57
Niladri_Biswas11-Nov-09 1:57 
AnswerRe: sql query Pin
The Man from U.N.C.L.E.11-Nov-09 3:19
The Man from U.N.C.L.E.11-Nov-09 3:19 
GeneralRe: sql query Pin
creative7711-Nov-09 7:39
creative7711-Nov-09 7:39 
Questiongetting complete word from a string in simple way Pin
uglyeyes10-Nov-09 15:55
uglyeyes10-Nov-09 15:55 

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.