<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQLAuthority News &#8211; Author Visit &#8211; Toronto, Canada &#8211; Insert Image in Database</title>
	<atom:link href="http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 10 Feb 2012 04:45:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: mayur dongre</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-55393</link>
		<dc:creator><![CDATA[mayur dongre]]></dc:creator>
		<pubDate>Sat, 29 Aug 2009 08:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-55393</guid>
		<description><![CDATA[hello sir 
    i am making window application for my college project i want to insert all  primary in combobox i am using this code



private void machineinformation_Load(object sender, EventArgs e)
        {
            //
            cn = new SqlConnection(&quot;server=.;integrated security=True;database=kata&quot;);
            cn.Open();
            txtcap.Text = &quot;connection Open&quot;;
            //for connection

            //
            
                 string count_qr = &quot;select count(*) as &#039;Total Rows&#039; from machine&quot;;
                cmd = new SqlCommand(count_qr, cn);
                dr = cmd.ExecuteReader();
            int count=0;
                if (dr.Read())
                {
                    count  = int.Parse(dr[0].ToString());
                }
                dr.Close();

            string combsrno_qr = &quot;select srno from machine&quot;;
            cmd = new SqlCommand(combsrno_qr, cn);
            dr = cmd.ExecuteReader();
            int i = 0;
            if (dr.Read())
            {
               
                while (count &gt; 0)
                {
                    
                    combsrno.Items.Add(dr[i].ToString());
                    i++;
                    count--;
                }
            }
                
            //for insert srno in combsrno 

        }

this give error
plese corret it or send me as posible as 
and also tell me that can we use sqldatareader to store rows]]></description>
		<content:encoded><![CDATA[<p>hello sir<br />
    i am making window application for my college project i want to insert all  primary in combobox i am using this code</p>
<p>private void machineinformation_Load(object sender, EventArgs e)<br />
        {<br />
            //<br />
            cn = new SqlConnection(&#8220;server=.;integrated security=True;database=kata&#8221;);<br />
            cn.Open();<br />
            txtcap.Text = &#8220;connection Open&#8221;;<br />
            //for connection</p>
<p>            //</p>
<p>                 string count_qr = &#8220;select count(*) as &#8216;Total Rows&#8217; from machine&#8221;;<br />
                cmd = new SqlCommand(count_qr, cn);<br />
                dr = cmd.ExecuteReader();<br />
            int count=0;<br />
                if (dr.Read())<br />
                {<br />
                    count  = int.Parse(dr[0].ToString());<br />
                }<br />
                dr.Close();</p>
<p>            string combsrno_qr = &#8220;select srno from machine&#8221;;<br />
            cmd = new SqlCommand(combsrno_qr, cn);<br />
            dr = cmd.ExecuteReader();<br />
            int i = 0;<br />
            if (dr.Read())<br />
            {</p>
<p>                while (count &gt; 0)<br />
                {</p>
<p>                    combsrno.Items.Add(dr[i].ToString());<br />
                    i++;<br />
                    count&#8211;;<br />
                }<br />
            }</p>
<p>            //for insert srno in combsrno </p>
<p>        }</p>
<p>this give error<br />
plese corret it or send me as posible as<br />
and also tell me that can we use sqldatareader to store rows</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – BLOB – Pointer to Image, Image in Database, FILESTREAM Storage Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-53648</link>
		<dc:creator><![CDATA[SQL SERVER – BLOB – Pointer to Image, Image in Database, FILESTREAM Storage Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Mon, 13 Jul 2009 01:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-53648</guid>
		<description><![CDATA[[...] images in database there are two common methods. I had previously blogged about the same subject on my visit to Toronto. With SQL Server 2008, we have a new method of FILESTREAM storage. However, the answer on when to [...]]]></description>
		<content:encoded><![CDATA[<p>[...] images in database there are two common methods. I had previously blogged about the same subject on my visit to Toronto. With SQL Server 2008, we have a new method of FILESTREAM storage. However, the answer on when to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Upload and Download Image/BLOB Data in SQL Server Ctrl+Shift+B</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-50169</link>
		<dc:creator><![CDATA[How to Upload and Download Image/BLOB Data in SQL Server Ctrl+Shift+B]]></dc:creator>
		<pubDate>Sun, 29 Mar 2009 12:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-50169</guid>
		<description><![CDATA[[...] 28, 2009   SQL Server Tags: C#, CLR, SQL Server 2005      There was a very interesting post over on SQL Authority on how to upload image data to SQL Server. The question was posed, &#8220;How do you then retrieve [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 28, 2009   SQL Server Tags: C#, CLR, SQL Server 2005      There was a very interesting post over on SQL Authority on how to upload image data to SQL Server. The question was posed, &#8220;How do you then retrieve [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQLAuthority News - Author Visit - Complete Wrapup of Microsoft MVP Summit 2009 Trip Journey to SQL Authority with Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48638</link>
		<dc:creator><![CDATA[SQLAuthority News - Author Visit - Complete Wrapup of Microsoft MVP Summit 2009 Trip Journey to SQL Authority with Pinal Dave]]></dc:creator>
		<pubDate>Tue, 10 Mar 2009 19:43:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48638</guid>
		<description><![CDATA[[...] SQLAuthority News - Author Visit - Toronto, Canada - Insert Image in Database [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQLAuthority News &#8211; Author Visit &#8211; Toronto, Canada &#8211; Insert Image in Database [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lam</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48323</link>
		<dc:creator><![CDATA[Lam]]></dc:creator>
		<pubDate>Sat, 07 Mar 2009 09:14:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48323</guid>
		<description><![CDATA[-- Added by Lam
-- Last modified 209.03.07
-- Using TextCopy in MSSQL$instancename\Binn for retrieving image.

-- 0. xp_cmdshell is turned on from sp_configure
sys.sp_configure &#039;xp_cmdshell&#039;, 1
RECONFIGURE;

GO
-- 1 Declaration
DECLARE @sql			VARCHAR(500),
		@server			sysname,
		@user			sysname,
		@pwd			sysname,
		@db				sysname,
		@table			sysname,
		@column			sysname,
		@whereclause	VARCHAR(500),
		@filename		VARCHAR(100),
		@filepath		VARCHAR(500)
		

-- 2. Config		
SET @server = @@SERVERNAME
SET	@user	= &#039;&#039;-- input login here
SET	@pwd	= &#039;&#039;-- and pwd
SET @db		= DB_NAME()
SET	@table	= &#039;ImageTest&#039;
SET	@column	= &#039;Image&#039;
SET	@whereclause = &#039;&quot;WHERE ID = 1&quot;&#039;
SET	@filename = &#039;ImageFromSQL.jpg&#039;
SET	@filepath = &#039;C:\tmp\&#039;

-- 3. Set textcopy path from path environment variable(manually)
-- And set sql string
SET @sql= &#039;TextCopy &#039; + 
			&#039; /S &#039; + @server + 
			&#039; /U &#039; + @user +
			&#039; /P &#039; + @pwd +
			&#039; /D &#039; + @db +
			&#039; /T &#039; + @table + 
			&#039; /C &#039; + @column + 
			&#039; /W &#039; + @whereclause + 
			&#039; /F &#039; + @filepath + @filename +
			&#039; /O &#039; + 
			&#039; /Z &#039; -- for debuging
			
EXEC master..xp_cmdshell @sql --,no_output if wanna see the debug
GO]]></description>
		<content:encoded><![CDATA[<p>&#8211; Added by Lam<br />
&#8211; Last modified 209.03.07<br />
&#8211; Using TextCopy in MSSQL$instancename\Binn for retrieving image.</p>
<p>&#8211; 0. xp_cmdshell is turned on from sp_configure<br />
sys.sp_configure &#8216;xp_cmdshell&#8217;, 1<br />
RECONFIGURE;</p>
<p>GO<br />
&#8211; 1 Declaration<br />
DECLARE @sql			VARCHAR(500),<br />
		@server			sysname,<br />
		@user			sysname,<br />
		@pwd			sysname,<br />
		@db				sysname,<br />
		@table			sysname,<br />
		@column			sysname,<br />
		@whereclause	VARCHAR(500),<br />
		@filename		VARCHAR(100),<br />
		@filepath		VARCHAR(500)</p>
<p>&#8211; 2. Config<br />
SET @server = @@SERVERNAME<br />
SET	@user	= &#8221;&#8211; input login here<br />
SET	@pwd	= &#8221;&#8211; and pwd<br />
SET @db		= DB_NAME()<br />
SET	@table	= &#8216;ImageTest&#8217;<br />
SET	@column	= &#8216;Image&#8217;<br />
SET	@whereclause = &#8216;&#8221;WHERE ID = 1&#8243;&#8216;<br />
SET	@filename = &#8216;ImageFromSQL.jpg&#8217;<br />
SET	@filepath = &#8216;C:\tmp\&#8217;</p>
<p>&#8211; 3. Set textcopy path from path environment variable(manually)<br />
&#8211; And set sql string<br />
SET @sql= &#8216;TextCopy &#8216; +<br />
			&#8216; /S &#8216; + @server +<br />
			&#8216; /U &#8216; + @user +<br />
			&#8216; /P &#8216; + @pwd +<br />
			&#8216; /D &#8216; + @db +<br />
			&#8216; /T &#8216; + @table +<br />
			&#8216; /C &#8216; + @column +<br />
			&#8216; /W &#8216; + @whereclause +<br />
			&#8216; /F &#8216; + @filepath + @filename +<br />
			&#8216; /O &#8216; +<br />
			&#8216; /Z &#8216; &#8212; for debuging</p>
<p>EXEC master..xp_cmdshell @sql &#8211;,no_output if wanna see the debug<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: riteshshah</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48305</link>
		<dc:creator><![CDATA[riteshshah]]></dc:creator>
		<pubDate>Sat, 07 Mar 2009 03:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48305</guid>
		<description><![CDATA[Hi Pinal, 

Let me give you congratulations for having a great honor to take part in Microsoft Global Summit. 

I am pleased that I am taking an opportunity to answer in your blog. After reading your blog I felt to create one detail example for same. I just created it on my blog at:

http://ritesh-shah.blogspot.com/2009/03/image-store-in-sql-server-2005-database.html
or 
http://riteshshahwordpress.com/2009/03/07/image-store-in-sql-server-2005-database-and-retrieve-it-in-aspnet-application-with-c/ 

Hope to see you soon and eager to know your experience from your own alluring words by your mouth. However, I get some of that from you blog. 

Thanks,

Ritesh Shah]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal, </p>
<p>Let me give you congratulations for having a great honor to take part in Microsoft Global Summit. </p>
<p>I am pleased that I am taking an opportunity to answer in your blog. After reading your blog I felt to create one detail example for same. I just created it on my blog at:</p>
<p><a href="http://ritesh-shah.blogspot.com/2009/03/image-store-in-sql-server-2005-database.html" rel="nofollow">http://ritesh-shah.blogspot.com/2009/03/image-store-in-sql-server-2005-database.html</a><br />
or<br />
<a href="http://riteshshahwordpress.com/2009/03/07/image-store-in-sql-server-2005-database-and-retrieve-it-in-aspnet-application-with-c/" rel="nofollow">http://riteshshahwordpress.com/2009/03/07/image-store-in-sql-server-2005-database-and-retrieve-it-in-aspnet-application-with-c/</a> </p>
<p>Hope to see you soon and eager to know your experience from your own alluring words by your mouth. However, I get some of that from you blog. </p>
<p>Thanks,</p>
<p>Ritesh Shah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ron</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48296</link>
		<dc:creator><![CDATA[Ron]]></dc:creator>
		<pubDate>Sat, 07 Mar 2009 00:35:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48296</guid>
		<description><![CDATA[I don&#039;t know if there is any way to do this in T-SQL but the CLR procedure below should do the job.

using System;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.IO;

public partial class StoredProcedures
{
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void usp_RetrieveBlobData(string query,string outpath)
    {
      using(SqlConnection connection = new SqlConnection(&quot;context connection=true&quot;)) 
      {
         connection.Open();
         SqlCommand command = new SqlCommand(query, connection);
         SqlDataReader reader = command.ExecuteReader();
         
         using (reader)
         {
            while(reader.Read())
            {
                FileStream fs = File.Create(outpath);
                BinaryWriter bw = new BinaryWriter(fs);

                byte[] file = (byte[])reader.GetSqlBinary(0);

                bw.Write(file);

                bw.Close();
                fs.Close();
            }
         }         
      }
    }
};

I threw this together real quick, so I know the code can be cleaned up.

The first parameter is the sql query and the second is the output path. Make sure the CLR procedure&#039;s permission level is set to external.]]></description>
		<content:encoded><![CDATA[<p>I don&#8217;t know if there is any way to do this in T-SQL but the CLR procedure below should do the job.</p>
<p>using System;<br />
using System.Data;<br />
using System.Data.Sql;<br />
using System.Data.SqlClient;<br />
using System.Data.SqlTypes;<br />
using Microsoft.SqlServer.Server;<br />
using System.IO;</p>
<p>public partial class StoredProcedures<br />
{<br />
    [Microsoft.SqlServer.Server.SqlProcedure]<br />
    public static void usp_RetrieveBlobData(string query,string outpath)<br />
    {<br />
      using(SqlConnection connection = new SqlConnection(&#8220;context connection=true&#8221;))<br />
      {<br />
         connection.Open();<br />
         SqlCommand command = new SqlCommand(query, connection);<br />
         SqlDataReader reader = command.ExecuteReader();</p>
<p>         using (reader)<br />
         {<br />
            while(reader.Read())<br />
            {<br />
                FileStream fs = File.Create(outpath);<br />
                BinaryWriter bw = new BinaryWriter(fs);</p>
<p>                byte[] file = (byte[])reader.GetSqlBinary(0);</p>
<p>                bw.Write(file);</p>
<p>                bw.Close();<br />
                fs.Close();<br />
            }<br />
         }<br />
      }<br />
    }<br />
};</p>
<p>I threw this together real quick, so I know the code can be cleaned up.</p>
<p>The first parameter is the sql query and the second is the output path. Make sure the CLR procedure&#8217;s permission level is set to external.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Hung</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48282</link>
		<dc:creator><![CDATA[Jerry Hung]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 20:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48282</guid>
		<description><![CDATA[I am sure i can Google around, but I have been lucky enough to never deal with BLOB objects in DB, so I&#039;ll let others share

Just want to mention, FILESTREAM in SQL Server 2008 is a cool feature to allocate actual BLOB objects OUTSIDE the database, while keeping reference pointers INSIDE the database
http://blogs.msdn.com/rdoherty/archive/2007/10/12/getting-traction-with-sql-server-2008-filestream.aspx]]></description>
		<content:encoded><![CDATA[<p>I am sure i can Google around, but I have been lucky enough to never deal with BLOB objects in DB, so I&#8217;ll let others share</p>
<p>Just want to mention, FILESTREAM in SQL Server 2008 is a cool feature to allocate actual BLOB objects OUTSIDE the database, while keeping reference pointers INSIDE the database<br />
<a href="http://blogs.msdn.com/rdoherty/archive/2007/10/12/getting-traction-with-sql-server-2008-filestream.aspx" rel="nofollow">http://blogs.msdn.com/rdoherty/archive/2007/10/12/getting-traction-with-sql-server-2008-filestream.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nimit</title>
		<link>http://blog.sqlauthority.com/2009/03/06/sqlauthority-news-author-visit-toronto-canada-insert-image-in-database/#comment-48281</link>
		<dc:creator><![CDATA[Nimit]]></dc:creator>
		<pubDate>Fri, 06 Mar 2009 19:51:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=3679#comment-48281</guid>
		<description><![CDATA[Here we can find how to retrive image from SQL Server. http://madhuottapalam.blogspot.com/2008/08/creating-files-from-images-stored-in.html]]></description>
		<content:encoded><![CDATA[<p>Here we can find how to retrive image from SQL Server. <a href="http://madhuottapalam.blogspot.com/2008/08/creating-files-from-images-stored-in.html" rel="nofollow">http://madhuottapalam.blogspot.com/2008/08/creating-files-from-images-stored-in.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

