This query is useful for create table and copy the schema and data from another table

March 8, 2013

–This query is useful for create table and copy the schema and data from another table

select * into tbldemo from dbo.tblEmployee

tbldemo-New table which have to create
dbo.tblEmployee-Old table ,Copy schema and data from this table
—Copy only schemaa not data

SELECT *
INTO my_new_table1
FROM tblEmployee
WHERE 1=2
–it will not generate p.k

Advertisements

Convert Bitmap image to Byte Array

March 5, 2013

MemoryStream stream = new MemoryStream();
Bitmap bitmap = new Bitmap();
bitmap.Save(stream, ImageFormat.Jpeg);

byte[] byteArray = stream.GetBuffer();