본문 바로가기

분류 전체보기590

DB에 저장된 이미지 불러오기 // Put user code to initialize the page here MemoryStream stream = new MemoryStream (); SqlConnection connection = new SqlConnection (@"server=test;database=pub;uid=sa;pwd=1234"); try { connection.Open (); SqlCommand command = new SqlCommand ("select image from Image", connection); byte[] image = (byte[]) command.ExecuteScalar (); stream.Write (image, 0, image.Length); Bitmap bitmap = new Bitmap.. 2009. 5. 14.
이미지를 db에 저장하기 // Create a byte[] from the input file int len = Upload.PostedFile.ContentLength; byte[] image = new byte[len]; Upload.PostedFile.InputStream.Read (image, 0, len); // Insert the image and comment into the database SqlConnection connection = new SqlConnection (@"server=test;database=pub;uid=sa;pwd=1234"); try { connection.Open (); SqlCommand cmd = new SqlCommand ("insert into Image " + "(Image, m.. 2009. 5. 14.
Crystal Reports TextObject ignores newline, carriage return, \r\n I have a text object in my crystal report, and i set the value programatically for it, using something like this: (rpt.Section3.ReportObjects["txtDate"] as TextObject).Text = DateTime.Now.ToShortDateString();this works fine, until you put a string with line breaks inside it, specifically \r\n or the carriage return character. This is a bug in CR for .Net, you can read the official blurb here. th.. 2009. 5. 14.
ImageCanvas Web User Control Source Code: ImageCanvas.zip 22 KB Introduction: Sending dynamic image content to browser has always been tricky issue. With System.Drawing namespace available to ASP.Net creating images on fly has become relatively simpler. In normal case we would use aspx page to stream image to web form like Now for image to be dynamic we need to pass some information to aspx page, which we are doing by passi.. 2009. 5. 14.