Move Window border less form c#

We can move windows border less form in 2 ways.  bool flag = false;         private void Form1_MouseDown(object sender, MouseEventArgs e)         {              flag = true;         }          private void Form1_MouseMove(object sender, MouseEventArgs e)         {             //Check if Flag is True ??? if so then make form position same             //as Cursor position             if (flag == true)    …

0

Difference between a stored procedure and function

Benefits of Stored Procedures Precompiled execution: SQL Server compiles each Stored Procedure once and then re utilizes the execution plan. This results in tremendous performance boosts when Stored Procedures are called repeatedly. Reduced client/server traffic: If network bandwidth is a concern in your environment then you’ll be happy to learn that Stored Procedures can reduce long SQL…

8

Cannot connect to WMI provider. You dont have permission to server or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. Invalid namespace [0*8004100e]

When I was trying to open Sql Server Configuration Manager 2012, I am receiving below error. I executed below command and was not able to resolve the issue. I downloaded WMI Diagnosis utility(http://www.microsoft.com/en-in/download/details.aspx?id=7684)  and diagnosed WMI service and found following connection errors but no luck. After some research, I was able to resolve by  1….

0

One or more types required to compile a dynamic expression cannot be found

Solution -Add Reference -> .NET -> add Microsoft.CSharp. Two things are important. Check the following: That your project properties are referencing .NET Framework 4 or higher (if that is not the case, change it: Right click on the project, select the “Properties…” menu item, then select as target framework “.NET Framework 4” (or higher)) That you have…

0

Read SSIS package programatically C#

static void Main(string[] args) { Console.WriteLine(); Application app = new Application(); Package p; p = app.LoadPackage(@”C:\Users\pvenkat\Desktop\Original.dtsx”, null); Executable e = (Executable)p; RecurseExecutables(e); Console.ReadKey(); } public static void RecurseExecutables(Executable e) { //Console.WriteLine(“Component : ” + e.ToString()); //Console.WriteLine(e.GetType()); if (e is TaskHost) { TaskHost p = (TaskHost)e; Console.WriteLine(p.Name); } if (e is Package) { Package p =…

0

file extension regular expression in c# in windows

Regular Expression : @”^(?:[\w]\:|\\)(\\[A-Z_\a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx|mht|pptx|ppt)$” you can add any no of extensions to above regex expression. How to use check is a filepath is matching with regular expression. if(Regex.IsMatch(filePath, @”^(?:[\w]\:|\\)(\\[A-Z_\a-z_\-\s0-9\.]+)+\.(txt|gif|pdf|doc|docx|xls|xlsx|mht|pptx|ppt)$”)) { // put your code here }

0

Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>) asp.net

Issue:   Server Error in ‘ASP.Net’ Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Resolution: If…

25

Create Database Backup using T-SQL and Delete Older Backup’s.

USE MASTER go DECLARE @DBNAME NVARCHAR(100), @DBFILENAME NVARCHAR(100), @BACKUPPATH NVARCHAR(255), @DBDESC NVARCHAR(255) SELECT @DBNAME = rtrim([Name]),  @DBFILENAME = rtrim([Filename]) FROM MASTER.DBO.SYSALTFILES AS files  inner join  MASTER.DBO.SYSFILEGROUPS AS groups  ON  files.groupID = groups.groupID WHERE DBID = (SELECT dbid FROM MASTER.DBO.SYSDATABASES   WHERE [Name] like ‘%DB NAME%’  ) DECLARE @C VARCHAR(20)SELECT @C =  CAST(DATEPART(MONTH,GETDATE()) AS VARCHAR(02)) +’_’+…

2

Create SQL Table Schema based on data from flat files

Hello All, Today we ll see how to create a SQL table schema based on flat files(excel, csv, txt formats). Steps: 1. Create a datatable and load data into datatable from a flat file. 2. Read each coloumn from datatable and set its data type, length and other configurable properties. 3. Convert C# data types…

0