Script a table from a ODBC database with C#
If you want to create a corresponding SQL Server database table, from a ODBC table, you can use the following C# function: Note This function is not bullet proof, but gives you a simple example:
If you want to create a corresponding SQL Server database table, from a ODBC table, you can use the following C# function: Note This function is not bullet proof, but gives you a simple example:
I was getting the error: MyApplication.exe has encountered a problem and needs to close. We are sorry for the inconvenience, but I was not getting any unhandled exceptions in my “HandleGlobalExceptions” event: AppDomain.CurrentDomain.UnhandledException +=
If you want to extract the contents of a msi package to filesystem, you can use the following C# function: public void ExtractMsiPackage() { string parameters = string.Empty; parameters = string.Format(@"/a {0} /qb TARGETDIR=""{1}""
If you are using SqlCacheDependency in you’re ASP .NET website, the database must have SQL Server Broker enabled. To enable SQL Server Broker on a SQL Server 2005 database use: USE master GO ALTER DATABASE
If you want to find and replace some text in all files of a given folder, including subfolders, you can use the following C# code: string rootfolder = @"C:\Temp"; string[] files = Directory.GetFiles(rootfolder, "*.*", SearchOption.AllDirectories);
If you want to execute an existing Microsoft SQL Server Agent Job in C# you an use the following function: The function uses SQL authentication to connect to the Microsoft SQL Server instance. using System;
I create a new VMWare development image and got the following error: Error loading TestPackage.dtsx: The component metadata for "component "SRC_TestTable" (1)" could not be upgraded to the newer version of the component. The
When you get the error: Error while trying to run project: ‘C:\…’ The debugger’s protocol is incompatible with the debuggee Check you’re supportedRuntime tag in you’re App.config or Web.config I ported a .NET 4.0 C#
If you want to show the log4net logging direct in your application by using a textbox, you can use the following link: http://weblogs.asp.net/psteele/archive/2010/01/25/live-capture-of-log4net-logging.aspx I tried it and it works great: using System; using System.Collections.Generic;
If you want to concatenate all items in a generic List<string> in C# you can use the following code: List<string> itemsInGenericList = new List<string> { "Item 1", "Item 2", "Item 3", "Item 4" };