C
Chris
I want do my insert to a database using a formview bound to an
objectdatasource. I also want to upload a file. I'm quite new to and this is
just test code but Is there any way I can pass the file as a byte array and
manipulate it in my business object. Currently what I have is this, but my
byte array in my business object is nothing. It's like it's not passed the
file as a stream. I think I am not binding the FileUpload to the
insertparameter but I don't know how to fix it. Regards, Chris.
<asp:FormView ID="frmvwCustomer" runat="server" DataSourceID="objdsCustomer"
DefaultMode="Insert" AllowPaging="True">
<InsertItemTemplate>
Name<asp:TextBox ID="txtname" runat="server"></asp:TextBox><br />
Email<asp:TextBox ID="txtemail" Text="<%# Bind('strEmail') %>"
runat="server"></asp:TextBox><br />
CV<asp:FileUpload ID="CV" runat="server" /><br />
<asp:Button ID="Button1" runat="server" CommandName="Insert"
Text="Button" />
</InsertItemTemplate>
</asp:FormView>
</div>
<asp:ObjectDataSource ID="objdsCustomer" runat="server"
InsertMethod="createcustomer"
SelectMethod="getcustomer_list" TypeName="Customer">
<InsertParameters>
<asparameter Name="strName" Type="Object" />
<asparameter Name="strEmail" Type="Object" />
<asparameter Name="CV" Type="Object" />
</InsertParameters>
</asp:ObjectDataSource>
Public Sub createcustomer(ByVal strname As String, ByVal strEmail As String,
ByVal cv() As Byte)
End Sub
objectdatasource. I also want to upload a file. I'm quite new to and this is
just test code but Is there any way I can pass the file as a byte array and
manipulate it in my business object. Currently what I have is this, but my
byte array in my business object is nothing. It's like it's not passed the
file as a stream. I think I am not binding the FileUpload to the
insertparameter but I don't know how to fix it. Regards, Chris.
<asp:FormView ID="frmvwCustomer" runat="server" DataSourceID="objdsCustomer"
DefaultMode="Insert" AllowPaging="True">
<InsertItemTemplate>
Name<asp:TextBox ID="txtname" runat="server"></asp:TextBox><br />
Email<asp:TextBox ID="txtemail" Text="<%# Bind('strEmail') %>"
runat="server"></asp:TextBox><br />
CV<asp:FileUpload ID="CV" runat="server" /><br />
<asp:Button ID="Button1" runat="server" CommandName="Insert"
Text="Button" />
</InsertItemTemplate>
</asp:FormView>
</div>
<asp:ObjectDataSource ID="objdsCustomer" runat="server"
InsertMethod="createcustomer"
SelectMethod="getcustomer_list" TypeName="Customer">
<InsertParameters>
<asparameter Name="strName" Type="Object" />
<asparameter Name="strEmail" Type="Object" />
<asparameter Name="CV" Type="Object" />
</InsertParameters>
</asp:ObjectDataSource>
Public Sub createcustomer(ByVal strname As String, ByVal strEmail As String,
ByVal cv() As Byte)
End Sub