摘要: >The Function: Public Sub ExportDatasetToExcel(ByVal ds As DataSet, ByVal strExcelFile As String) Dim conn As New OleDbConnection(String.Format("provider=Microsoft.Jet.OLEDB.4.0; Data Source='{0}';" & "Extended Properties='Excel 8.0;HDR=YES;'", strExcelFile 阅读全文
posted @ 2012-04-01 20:48 sandeepparekh9 阅读(180) 评论(0) 推荐(0)
摘要: 1. Add List box on a Forms. 2. Now add a reference to System.Diagnostics Code: Process[] curProcesses = Process.GetProcesses(); foreach (Process p in curProcesses) { listBox1.Items.Add(p.ProcessName); } Output: 阅读全文
posted @ 2012-04-01 20:47 sandeepparekh9 阅读(153) 评论(0) 推荐(0)
摘要: Here Is The Class: using System;using System.Drawing;using System.Windows.Forms;namespace MoveControl{ sealed class clsMoveControl { public enum Direction { Any, Horizontal, Vertical } public static void StartMoving(Control cntrl) ... 阅读全文
posted @ 2012-04-01 20:44 sandeepparekh9 阅读(173) 评论(0) 推荐(0)
摘要: Let's Say i have following array: string[] myArray = new string[6]; myArray[0] = "a"; myArray[1] = "b"; myArray[2] = " "; //space myArray[3] = "c"; myArray[4] = ""; //null myArray[5] = "d"; I want to remove the space and null par... 阅读全文
posted @ 2012-04-01 20:43 sandeepparekh9 阅读(163) 评论(0) 推荐(0)
摘要: Just a small Application i made to change wallpapers automatically at regular interval. Screen: I works fine with Windows XP and windows 7 . Well, i wont go to deep in code here is the complete project. enjoy. Download: Wallpaper Changer 阅读全文
posted @ 2012-04-01 20:42 sandeepparekh9 阅读(195) 评论(0) 推荐(0)
摘要: Once i was working with the Microsoft's PictureBox control. I noticed the each time i want to change the image i will have to create an Image object and Load my Image into and Assign it to PictureBox . And if i want to see the old pic (before assigning to new) i will have to again do the same. S 阅读全文
posted @ 2012-04-01 20:37 sandeepparekh9 阅读(150) 评论(0) 推荐(0)
摘要: We will be Accomplishing using the Windows Registry. Main Registry to work here is : "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products" Just Write Down The Following Code the Form's Loading Event (Form Contains No Control): C#.NET private void Form1_Load(o 阅读全文
posted @ 2012-04-01 20:34 sandeepparekh9 阅读(197) 评论(0) 推荐(0)
摘要: MySql Query : SELECT COLUMN_NAME , DATA_TYPE , CHARACTER_MAXIMUM_LENGTH , NUMERIC_PRECISION , NUMERIC_SCALE , EXTRA , COLUMN_KEY , COLUMN_DEFAULT , IS_NULLABLE , COLUMN_COMMENTFROM INFORMATION_SCHEMA.COLUMNSWHERE table_name = 'YourTableName' ... 阅读全文
posted @ 2012-04-01 20:31 sandeepparekh9 阅读(172) 评论(0) 推荐(0)
摘要: >MySql Query: SELECT TABLE_NAMEFROM INFORMATION_SCHEMA.TABLESWHERE TABLE_SCHEMA = 'test' Example OutPut: 阅读全文
posted @ 2012-04-01 20:30 sandeepparekh9 阅读(282) 评论(0) 推荐(0)
摘要: Stopwatchinstance can measure elapsed time for one interval, or the total of elapsed time across multiple intervals. In a typicalStopwatchscenario, you call theStartmethod, then eventually call theStopmethod, and then you check elapsed time using theElapsedproperty. (From MSDN) Let say i want to fi. 阅读全文
posted @ 2012-04-01 20:28 sandeepparekh9 阅读(244) 评论(0) 推荐(0)
摘要: Ever Thought if it was possible to not WebBrower control and use the Firefox Browser in your c# window Application...?? Yes ,, It is possible using GeckoFx wrapper class for C#.net and vb also. You will need the Followings: 1. GeckoFx Wrapper [Download] 2. Xul Runner [Download] (Download the zip ... 阅读全文
posted @ 2012-04-01 20:26 sandeepparekh9 阅读(1484) 评论(2) 推荐(0)
摘要: I will just go with the Example as its SelfExclamatory. Sql Query:declare @string varchar(500)set @string = 'ABC,DEF,GHIJK,LMNOPQRS,T,UV,WXY,Z'declare @pos INTdeclare @piece varchar(500)-- Need to tack a delimiter onto the end of the input string if one doesn’t existif right(rtrim(@string),1 阅读全文
posted @ 2012-04-01 20:24 sandeepparekh9 阅读(171) 评论(0) 推荐(0)
摘要: This a simple Stored procedure to count the total numbers of rows in each table of your Database. I assume you have Northwind database installed. The Stored ProcedureIF EXISTS ( SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[sp_GetRowsCountForAllTables]') ... 阅读全文
posted @ 2012-04-01 20:22 sandeepparekh9 阅读(189) 评论(0) 推荐(0)
摘要: I assume You have Northwind Database. I will be using The Employee Table. As Show in the figure there are 6 Selected cells which are the Duplicates( Just assume it) I want to find this number ( i mean 6.) The query for the above is: SELECT Title , COUNT(Title) AS NumOccurrencesFROM dbo.E... 阅读全文
posted @ 2012-04-01 20:18 sandeepparekh9 阅读(124) 评论(0) 推荐(0)
摘要: Here is the Script: USE Northwind GOCREATE TABLE #temp ( table_name SYSNAME , row_count INT , reserved_size VARCHAR(50) , data_size VARCHAR(50) , index_size VARCHAR(50) , unused_size VARCHAR(50) )SET NOCOUNT ONINSERT #temp EXEC sp_msforeachtable 'sp_spaceused ''?'''... 阅读全文
posted @ 2012-04-01 20:15 sandeepparekh9 阅读(150) 评论(0) 推荐(0)
摘要: This is simple sql query:USE masterGoIF EXISTS ( SELECT name FROM sys.databases WHERE name = 'MyDataBase' ) PRINT 'Exists'ELSE PRINT 'Does Not Exists' 阅读全文
posted @ 2012-04-01 20:12 sandeepparekh9 阅读(297) 评论(0) 推荐(0)
摘要: NET Framework 3.0 consists of four major new components: Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies. See WPF SDK for developer article.. 阅读全文
posted @ 2012-04-01 19:59 sandeepparekh9 阅读(361) 评论(0) 推荐(0)
摘要: Imports System.SecurityImports System.Security.CryptographyImports System.IOImports System.Runtime.InteropServicesImports System.Text.RegularExpressionsImports System.Text Encryption: Public Function Encrypt(ByVal plainText As String) As String Dim passPhrase As String = "yourPassPhrase" . 阅读全文
posted @ 2012-04-01 19:57 sandeepparekh9 阅读(481) 评论(0) 推荐(0)
摘要: Let 's Say I have Following Array: string[] st = new string[5]; st[0] = "Animation"; st[1] = "Action"; st[2] = "Romance"; st[3] = "Drame"; st[4] = "Comedy"; Now I want to Merge all of it with ',' Delimiter Like Below: Output : Animation,A 阅读全文
posted @ 2012-04-01 19:56 sandeepparekh9 阅读(174) 评论(0) 推荐(0)
摘要: In this post i will show you how to read the Tags like Album,Artist,Song Title,Year etc from mp3 , avi , ogg, Asf, Divx, png etc.. You will need Taglib - Sharp Library for this purpose . Download the Library :http://download.banshee.fm/taglib-sharp/ you will findtaglib-sharp.dll That's what we n 阅读全文
posted @ 2012-04-01 19:54 sandeepparekh9 阅读(239) 评论(0) 推荐(0)