Posts

Showing posts from April, 2014

how to delete entire table or stored procedure at a time in sql ?

sometime we need to delete all the table at a time ,so i am writing a code to delete table and  Stored  procedure. 1-For table deletion declare @procName varchar(500) declare cur cursor for select [name] from sys.objects where type = 'u' open cur fetch next from cur into @procName while @@fetch_status = 0 begin exec('drop table ' + @procName) fetch next from cur into @procName end close cur deallocate cur 2-For Stored procedure deletion- declare @procName varchar(500) declare cur cursor for select [name] from sys.objects where type = 'p' open cur fetch next from cur into @procName while @@fetch_status = 0 begin exec('drop procedure ' + @procName) fetch next from cur into @procName end close cur deallocate cur

How To search entire database ?

While browsing the SQL Server newsgroups, every once in a while, I see a request for a script that can search all the columns of all the tables in a given database for a specific keyword. I never took such posts seriously. But then recently, one of my network administrators was troubleshooting a problem with Microsoft Operations Manager (MOM). MOM uses SQL Server for storing all the computer, alert and performance related information. He narrowed the problem down to something specific, and needed a script that can search all the MOM tables for a specific string. I had no such script handy at that time, so we ended up searching manually. That's when I really felt the need for such a script and came up with this stored procedure "SearchAllTables". It accepts a search string as input parameter, goes and searches all char, varchar, nchar, nvarchar columns of all tables (only user created tables. System tables are excluded), owned by all users in the current database. Feel ...

How to encrypt Bitmap image in c#

In this post I will show you how to encrypt bitmap image in c#.The technique is very simple.First we extract header from the image and then encrypt the rest byte data and then combined the header with this encrypted data. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace Enc { class Program { static string FILENAME = @"D:\ub.bmp" ; static string ENCFILENAME = @"D:\enc.bmp" ; static void Main( string [] args) { //Create instance of DES TripleDESCryptoServiceProvider des = new TripleDESCryptoServiceProvider(); //Generate IV and Key des.GenerateIV(); des.GenerateKey(); //Set Encryption mode des.Mode = CipherMode.ECB; //Read FileStream fileStream = new FileStream(FILENAME,...

How to encrypt Bitmap image in c#

EXPLAIN  :Sometime we need to countdown timer on website as for bidding website or any else. Then we can use Ajax control to achieve this task. Here I created code for countdown timer (server time). I used server countdown timer because for bidding we need server time not client machine time which used in javascript code. note : need ajax control toolkit to add first. It is freely available at http://www.asp.net/ajaxlibrary/AjaxControlToolkitSamlpleSite/ Here, you can find many sample code for how use ajax controls in your website. In addition I make CSS for round corner of DIV tag. my div is as a circle. ........................................Design Page ... Save it as timer.aspx............................................................ <% @   Page   Language ="C#"   AutoEventWireup ="true"   CodeFile ="timer.aspx.cs" Inherits ="timer"   %> <% @   Register   assembly ="AjaxControlToolkit"   namespace ="...

CountDown -Timer ajax control c#.net Asp.net

dgtyrtyrertyurt