By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,279 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,279 IT Pros & Developers. It's quick & easy.

Masterpage insert record problem

P: n/a
Bo
Can anyone explain why the code below inserts blank values into my access
database while the same code without the masterpagefile reference works and
inserts the values?

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled
Page" %>

<Script runat="server">

Private Sub Insertimg(ByVal Source As Object, ByVal e As EventArgs)

SqlDataSource1.Insert()

End Sub

</Script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:minConnectionString %>"

ProviderName="<%$ ConnectionStrings:minConnectionString.ProviderName %>"

InsertCommand="INSERT INTO iconimg (Imgname, Imgpath) VALUES (@Imgn,@Imgp)">

<insertparameters>

<asp:FormParameter FormField="Imgname" Name="Imgn" />

<asp:FormParameter FormField="Imgpath" Name="Imgp" />

</insertparameters>

</asp:SqlDataSource>

Billednavn: <asp:TextBox ID="Imgname" runat="server"></asp:TextBox>

Billedsti: <asp:TextBox ID="Imgpath" runat="server"></asp:TextBox>

<asp:button

id="Button2"

runat="server"

text="Insert"

onclick="Insertimg" />

</asp:Content>
Feb 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.