Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What do you mean by generic error?</p> <p>In any event, I see a couple of issues with your button click event:</p> <pre><code>If flupload.FileName.GetType.ToString = "jpg" Then Label1.Text = "Hurrey" Exit Sub End If </code></pre> <p>The statement <code>flupload.FileName.GetType.toString = "jpg"</code> shouldn't even compile. <code>GetType()</code> returns the type of the object (in this case, System.String). </p> <p>If it even did compile, the statement would always fail, regardless of what FileName was. I think what you're looking for is this:</p> <pre><code>If flupload.FileName.EndsWith("jpg") Then </code></pre> <p>I'm not sure why you're going through all the permutations you are in the rest of the event handler for the button click, as saving the file should be as simple as calling <code>flupload.SaveAs(&lt;path&gt;)</code>.</p> <p>Also, you are exposing your app to SQL Injection Attacks with the following code:</p> <pre><code>Dim mycommand As New SqlCommand("Insert chairperson (memberid,name,period,achieve,imageurl,other) Values ( '" &amp; smemberid &amp; "','" &amp; TextBox1.Text &amp; "','" &amp; TextBox2.Text &amp; "','" &amp; TextBox3.Text &amp; "','" &amp; photoid &amp; "','" &amp; TextBox4.Text &amp; "' )", con) </code></pre> <p>You should be using parameterized queries.</p> <p>Read (thoroughly) <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx" rel="nofollow">FileUpload Class</a> - it has everything you need to get started, and has example code as well. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload