<?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/"
		>
<channel>
	<title>Comments on: Displaying An Image Stored In A SQL Server Database On An ASP.NET Page Using VB.NET</title>
	<atom:link href="http://www.dougv.com/2008/08/21/displaying-an-image-stored-in-a-sql-server-database-on-an-aspnet-page-using-vbnet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dougv.com/2008/08/21/displaying-an-image-stored-in-a-sql-server-database-on-an-aspnet-page-using-vbnet/</link>
	<description>ASP.NET, PHP, XML, JavaScript, Web geekery, Entrepreneurship</description>
	<lastBuildDate>Fri, 18 May 2012 10:23:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Doug Vanderweide</title>
		<link>https://www.dougv.com/2008/08/21/displaying-an-image-stored-in-a-sql-server-database-on-an-aspnet-page-using-vbnet/#comment-146</link>
		<dc:creator>Doug Vanderweide</dc:creator>
		<pubDate>Mon, 25 Aug 2008 21:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=712#comment-146</guid>
		<description>I can&#039;t speak to problems you are having unless you better describe your problem than it &quot;fails.&quot; I also cannot further support you for free, sorry.

I can advise this:

&lt;ul&gt;
&lt;li&gt;You should not use a varchar column as a primary key, especially if the key is likely to be repeated. This is highly likely if you&#039;re going to let users generate values that will serve as keys, and almost certain if you are using the names of uploaded files as key values. Just add an int column to your table and assign it as the identity column for the table, then use its numbers as your primary keys.&lt;/li&gt;
&lt;li&gt;Your GetRandomImage() subroutine will work if you:
&lt;ol&gt;
&lt;li&gt;Invoke it in the Page_Load() subroutine; and&lt;/li&gt;
&lt;li&gt;Have an image properly stored in an image / blob column, and that image has IPhone as its key. Keep in mind that IPhone will be case-sensitive; if your key column&#039;s value is actually Iphone or iPhone or iphone, the dbImage script will throw an exception.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;If the previous proves not to be the problem, almost certainly you have wrongly altered the dbImage.aspx page. Simply call that page with a key value you know to be good. If you see a picture, then the problem is how you are calling it. If you see an exception, then you have incorrectly modified the dbImage.aspx page.&lt;/li&gt;
&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<p>I can&#8217;t speak to problems you are having unless you better describe your problem than it &#8220;fails.&#8221; I also cannot further support you for free, sorry.</p>
<p>I can advise this:</p>
<ul>
<li>You should not use a varchar column as a primary key, especially if the key is likely to be repeated. This is highly likely if you&#8217;re going to let users generate values that will serve as keys, and almost certain if you are using the names of uploaded files as key values. Just add an int column to your table and assign it as the identity column for the table, then use its numbers as your primary keys.</li>
<li>Your GetRandomImage() subroutine will work if you:
<ol>
<li>Invoke it in the Page_Load() subroutine; and</li>
<li>Have an image properly stored in an image / blob column, and that image has IPhone as its key. Keep in mind that IPhone will be case-sensitive; if your key column&#8217;s value is actually Iphone or iPhone or iphone, the dbImage script will throw an exception.</li>
</ol>
</li>
<li>If the previous proves not to be the problem, almost certainly you have wrongly altered the dbImage.aspx page. Simply call that page with a key value you know to be good. If you see a picture, then the problem is how you are calling it. If you see an exception, then you have incorrectly modified the dbImage.aspx page.</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: human_magician</title>
		<link>https://www.dougv.com/2008/08/21/displaying-an-image-stored-in-a-sql-server-database-on-an-aspnet-page-using-vbnet/#comment-145</link>
		<dc:creator>human_magician</dc:creator>
		<pubDate>Fri, 22 Aug 2008 07:40:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=712#comment-145</guid>
		<description>Hi, I asked that question you answered and I have no idea you&#039;d make a blog out of it:D

well, I&#039;ve tried your code but it didn&#039;t work I don&#039;t know why. But of course I didn&#039;t use your code directly, I changed it a bit so it would fit with the database.

my database primary key is not int,it&#039;s varchar called Judul (Judul means title in my language).I make it so people only need to write the title of the image to show it,but it didn&#039;t show up. :(

I tried the first and second method to display the image (img tag and the image control).

here&#039;s the GetRandomImage() procedure that I&#039;ve changed (it&#039;s only a little though)

    Sub GetRandomImage()

        Dim strJudul As String = &quot;IPhone&quot; &#039; of course IPhone is just an example, I&#039;ll
                                                          &#039; modify it in the future so people only
                                                          &#039; need to input their title

        strJudul = &quot;dbImage.aspx?judul=&quot; &amp; strJudul

        &#039;assign ImageUrl for image control
        &#039;to be URL of dbImage.aspx with ID generated above
        Image1.ImageUrl = strJudul

    End Sub

the dbImage.aspx.vb code is just like what you wrote up there,just a little changes to fit the database.

I don&#039;t know why this fails,but for the time being I&#039;ll code the other parts of the website first before taking care of the image retriever again.

anyway,thanks for helping and making a blog out of my question :D</description>
		<content:encoded><![CDATA[<p>Hi, I asked that question you answered and I have no idea you&#8217;d make a blog out of it:D</p>
<p>well, I&#8217;ve tried your code but it didn&#8217;t work I don&#8217;t know why. But of course I didn&#8217;t use your code directly, I changed it a bit so it would fit with the database.</p>
<p>my database primary key is not int,it&#8217;s varchar called Judul (Judul means title in my language).I make it so people only need to write the title of the image to show it,but it didn&#8217;t show up. <img src='https://www.dougv.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I tried the first and second method to display the image (img tag and the image control).</p>
<p>here&#8217;s the GetRandomImage() procedure that I&#8217;ve changed (it&#8217;s only a little though)</p>
<p>    Sub GetRandomImage()</p>
<p>        Dim strJudul As String = &#8220;IPhone&#8221; &#8216; of course IPhone is just an example, I&#8217;ll<br />
                                                          &#8216; modify it in the future so people only<br />
                                                          &#8216; need to input their title</p>
<p>        strJudul = &#8220;dbImage.aspx?judul=&#8221; &amp; strJudul</p>
<p>        &#8216;assign ImageUrl for image control<br />
        &#8216;to be URL of dbImage.aspx with ID generated above<br />
        Image1.ImageUrl = strJudul</p>
<p>    End Sub</p>
<p>the dbImage.aspx.vb code is just like what you wrote up there,just a little changes to fit the database.</p>
<p>I don&#8217;t know why this fails,but for the time being I&#8217;ll code the other parts of the website first before taking care of the image retriever again.</p>
<p>anyway,thanks for helping and making a blog out of my question <img src='https://www.dougv.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

