or
| <rad:RadGrid ID="Page3_DisplayPayables_rgPayables" runat="server" |
| AlternatingRowStyle-BackColor="#ddeeee" AutoGenerateColumns="false" |
| EnableAJAX="True" GridLines="None" HeaderStyle-HorizontalAlign="Left" |
| Height="150" onitemcommand="Page3_DisplayPayables_rgPayables_ItemCommand" |
| onitemdatabound="Page3_DisplayPayables_rgPayables_ItemDataBound" > |
| <HeaderStyle BackColor="Black" ForeColor="White" Height="15px" /> |
| <ClientSettings> |
| <Scrolling AllowScroll="True" SaveScrollPosition="True" |
| UseStaticHeaders="True" /> |
| </ClientSettings> |
| <MasterTableView AlternatingItemStyle-BackColor="#ddeeee" Width="100%"> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <rad:GridBoundColumn DataField="FileNumber" HeaderText="File Number" |
| ItemStyle-Width="70"> |
| <ItemStyle Width="70" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="VendorNumber" HeaderText="Vendor" |
| ItemStyle-Width="40px"> |
| <ItemStyle Width="40px" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="InvoiceDate" HeaderText="Date" |
| ItemStyle-Width="50px"> |
| <ItemStyle Width="50px" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="BillOfLading" HeaderText="B/L" |
| ItemStyle-Width="80px"> |
| <ItemStyle Width="80px" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="AmountUSD" |
| DataFormatString="{0:###,###,###.00}" HeaderText="Amount USD" |
| ItemStyle-HorizontalAlign="Right" ItemStyle-Width="80px"> |
| <ItemStyle HorizontalAlign="Right" Width="80px" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="ProratedUSD" |
| DataFormatString="{0:###,###,###.00}" HeaderText="Prorated Amount USD" |
| ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px"> |
| <ItemStyle HorizontalAlign="Right" Width="100px" /> |
| </rad:GridBoundColumn> |
| <rad:GridBoundColumn DataField="DifferenceUSD" |
| DataFormatString="{0:###,###,###.00}" HeaderText="Difference USD" |
| ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px"> |
| <ItemStyle HorizontalAlign="Right" Width="100px" /> |
| </rad:GridBoundColumn> |
| <rad:GridTemplateColumn> |
| <ItemTemplate> |
| <asp:ImageButton ID="ibtnDelete" runat="server" |
| CommandArgument='<%#Container.DataItem("VendorPayableID")%>' |
| ImageUrl="~/images/delete.png" |
| OnClick="Page3_DisplayPayables_ibtnDeletePayable_Click" /> |
| </ItemTemplate> |
| </rad:GridTemplateColumn> |
| </Columns> |
| <AlternatingItemStyle BackColor="#DDEEEE" /> |
| </MasterTableView> |
| </rad:RadGrid> |
| <asp:UpdatePanel ID="Page3_SearchPayables_upnlControls" runat="server" ChildrenAsTriggers="true" |
| UpdateMode="conditional" OnInit="Page3_SearchPayables_upnlControls_Init"> |
| <Triggers> |
| <asp:AsyncPostBackTrigger ControlID="Page3_EnterInvoice_btnAddInvoice" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_EnterInvoice_btnUpdateInvoice" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_EnterInvoice_btnClearForNewInvoice" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_EnterInvoice_btnDeleteInvoice" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_SearchPayables_btnCheckAll" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_SearchPayables_btnUncheckAll" EventName="Click" /> |
| <asp:AsyncPostBackTrigger ControlID="Page3_SearchPayables_btnAddExistingPayable" |
| EventName="Click" /> |
| </Triggers> |
| <ContentTemplate> |
| <hr /> |
| <table width="800px"> |
| <tr> |
| <td colspan="2" valign="top" align="left" style="font-size: large; font-weight: bold; |
| height: 30px;"> |
| Search/Select Existing Payables |
| </td> |
| </tr> |
| <tr> |
| <td align="right" colspan="2"> |
| File #: <asp:TextBox ID="Page3_SearchPayables_txtFileNumber" Width="75px" runat="server" |
| OnInit="Page3_SearchPayables_txtFileNumber_Init"></asp:TextBox> |
| Date from |
| <rad:RadDatePicker ID="Page3_SearchPayable_rdpStartDate" runat="server" Width="75px" |
| OnInit="Page3_SearchPayable_rdpStartDate_Init"> |
| <DateInput Skin=""> |
| </DateInput> |
| </rad:RadDatePicker> |
| to <rad:RadDatePicker ID="Page3_SearchPayable_rdpEndDate" runat="server" |
| Width="75px" OnInit="Page3_SearchPayable_rdpEndDate_Init"> |
| <DateInput Skin=""> |
| </DateInput> |
| </rad:RadDatePicker> |
| B/L: <asp:TextBox ID="Page3_SearchPayables_txtBL" Width="75px" |
| runat="server" OnInit="Page3_SearchPayables_txtBL_Init"></asp:TextBox> |
| Amount: <rad:RadNumericTextBox ID="Page3_SearchPayables_rntAmount" runat="server" |
| MaxValue="999999999.99" MinValue="0" Skin="WebBlue" Type="Number" NumberFormat-DecimalDigits="2" |
| Width="75px" OnInit="Page3_SearchPayables_rntAmount_Init"> |
| <NumberFormat DecimalDigits="2" /> |
| </rad:RadNumericTextBox> |
| |
| <asp:Button ID="Page3_SearchPayables_btnSearch" CssClass="ButtonImageStyle" runat="server" |
| Text="Search" OnClick="Page3_SearchPayables_btnSearch_Click" OnInit="Page3_SearchPayables_btnSearch_Init" /> |
| </td> |
| </tr> |
| <tr> |
| <td colspan="2"> |
| <rad:RadGrid ID="Page3_SearchPayables_rgSearchPayables" runat="server" |
| HeaderStyle-HorizontalAlign="Left" Height="150" |
| AlternatingRowStyle-BackColor="#ddeeee" AutoGenerateColumns="false" Width="800px" GridLines="None"> |
| <HeaderStyle BackColor="Black" ForeColor="White" Height="15px" /> |
| <ClientSettings> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" /> |
| </ClientSettings> |
| <MasterTableView Width="100%" AlternatingItemStyle-BackColor="#ddeeee" |
| DataKeyNames="FileNumber,Vendor,PayableDate,BL,InvoiceUSD"> |
| <Columns> |
| <rad:GridTemplateColumn> |
| <ItemTemplate> |
| <asp:CheckBox ID="Page3_SearchPayables_chkAddPayable" runat="server" AutoPostBack="true" |
| OnCheckedChanged="Page3_SearchPayables_chkAddPayable_CheckChanged" /> |
| </ItemTemplate> |
| </rad:GridTemplateColumn> |
| <rad:GridBoundColumn DataField="FileNumber" HeaderText="File #" ItemStyle-Width="100" /> |
| <rad:GridBoundColumn DataField="Vendor" HeaderText="Vendor" ItemStyle-Width="100" /> |
| <rad:GridBoundColumn DataField="PayableDate" HeaderText="Date" ItemStyle-Width="100" /> |
| <rad:GridBoundColumn DataField="BL" HeaderText="B/L" ItemStyle-Width="125" /> |
| <rad:GridBoundColumn DataField="InvoiceUSD" HeaderText="Amount USD" ItemStyle-Width="90" |
| ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,###.00}" /> |
| <%-- taken out because of divide by zero error (see stored proc for more info) |
| <rad:GridBoundColumn DataField="ProratedUSD" HeaderText="Prorated USD" ItemStyle-Width="90" |
| ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,###.00}" /> |
| <rad:GridBoundColumn DataField="DifferenceUSD" HeaderText="Difference USD" ItemStyle-Width="90" |
| ItemStyle-HorizontalAlign="Right" DataFormatString="{0:###,###,###.00}" /> |
| --%> </Columns> |
| </MasterTableView> |
| </rad:RadGrid> |
| </td> |
| </tr> |
| <tr> |
| <td align="left"> |
| <asp:Button ID="Page3_SearchPayables_btnCheckAll" CssClass="ButtonImageStyle" runat="server" |
| Text="Check All" OnClick="Page3_SearchPayables_btnCheckAll_Click" OnInit="Page3_SearchPayables_btnCheckAll_Init" /> |
| |
| <asp:Button ID="Page3_SearchPayables_btnUncheckAll" CssClass="ButtonImageStyle" runat="server" |
| Text="Uncheck All" OnClick="Page3_SearchPayables_btnUncheckAll_Click" OnInit="Page3_SearchPayables_btnUncheckAll_Init" /> |
| </td> |
| <td align="right"> |
| <asp:Button ID="Page3_SearchPayables_btnAddExistingPayable" CssClass="ButtonImageStyle" |
| runat="server" Text="Add Checked Payables" OnClick="Page3_SearchPayables_btnAddExistingPayable_Click" |
| OnInit="Page3_SearchPayables_btnAddExistingPayable_Init" /> |
| </td> |
| </tr> |
| </table> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
The code fired by the image button click:
| Protected Sub Page3_DisplayPayables_ibtnDeletePayable_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) |
| Dim ibtnDelete As ImageButton = CType(sender, ImageButton) |
| Dim intVendorInvoiceID As Integer = CType(Page3_DisplayInvoice_hdnInvoiceID.Value, Integer) |
| Dim intVendorPayableID As Integer = ibtnDelete.CommandArgument |
| Dim taPayable As New xsdVendorPayablesTableAdapters.QueriesTableAdapter() |
| taPayable.mar_spDeleteVendorPayable(intVendorPayableID, clsGlobalClass.strSessionUser) |
| Page3_DisplayInvoicePayables_FillControls(intVendorInvoiceID) |
| Page3_SearchPayables_FillPayablesGrid(intVendorInvoiceID) |
| Page3_SearchPayables_upnlControls.Update() |
| End Sub |
| Protected Sub Page3_DisplayPayables_rgPayables_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) |
| If e.Item.ItemType <> Telerik.WebControls.GridItemType.Item Then Return |
| Dim ibtnDelete As ImageButton = CType(e.Item.FindControl("ibtnDelete"), ImageButton) |
| ScriptManager1.RegisterAsyncPostBackControl(ibtnDelete) |
| End Sub |
| <FilterTemplate> | |||||||||||||||||
| <telerik:RadComboBox ID="DeptID" runat="server" MarkFirstMatch="True" DataSourceID="SqlDept" | |||||||||||||||||
| DataTextField="DeptName" DataValueField="DeptID" Width="200" AllowCustomText="false" | |||||||||||||||||
| OnClientDropDownClosing="OnClientDropDownClosing" EnableItemCaching="false" EnableLoadOnDemand="false" | |||||||||||||||||
| EnableVirtualScrolling="false" ShowMoreResultsBox="False" | |||||||||||||||||
| AutoPostBack="false" OnSelectedIndexChanged="DeptLoadEmployee" | |||||||||||||||||
| TabIndex="1" ToolTip="DeptID" AppendDataBoundItems="true" | |||||||||||||||||
| OnClientSelectedIndexChanged="SelectedIndexChangedDeptID" | |||||||||||||||||
| SelectedValue='<%# TryCast(Container, GridItem).OwnerTableView.GetColumn("DeptID").CurrentFilterValue %>'> | |||||||||||||||||
| <Items> | |||||||||||||||||
| <telerik:RadComboBoxItem Text="All" Value="" /> | |||||||||||||||||
| </Items> | |||||||||||||||||
| </telerik:RadComboBox> | |||||||||||||||||
| <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server"> | |||||||||||||||||
| <script type="text/javascript"> | |||||||||||||||||
| function SelectedIndexChangedDeptID(sender, args) { | |||||||||||||||||
| var tableView = $find("<%# TryCast(Container, GridItem).OwnerTableView.ClientID %>"); | |||||||||||||||||
| tableView.filter("DeptID", args.get_item().get_value(), "EqualTo"); | |||||||||||||||||
| } | |||||||||||||||||
| </script> | |||||||||||||||||
| </telerik:RadScriptBlock> | |||||||||||||||||
</FilterTemplate>
|
| Protected Sub DeptLoadEmployee(ByVal source As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) |
| Dim editedItem As GridFilteringItem = TryCast(TryCast(source, RadComboBox).NamingContainer, GridFilteringItem) |
| Dim DeptID As RadComboBox = TryCast(source, RadComboBox) |
| Dim EmployeeID As RadComboBox = TryCast(editedItem.FindControl("EmployeeID"), RadComboBox) |
| EmployeeID.Items.Clear() |
| EmployeeID.DataSource = LoadEmployeeID(e.Value) |
| EmployeeID.DataBind() |
| AddBlankItemtoCombo(EmployeeID) |
| EmployeeID.SelectedIndex = 0 |
| End Sub |
| Protected Function LoadEmployeeID(ByVal ID As String) As DataTable |
| Dim dt As New DataTable() |
| If Not ID = String.Empty Then |
| Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("TEST").ConnectionString) |
| Dim cmd As New SqlCommand |
| cmd.CommandType = CommandType.StoredProcedure |
| cmd.CommandText = "P_S_EmployeeByDept" |
| cmd.Connection = connection |
| Dim adapter As New SqlDataAdapter() |
| adapter.SelectCommand = cmd |
| adapter.SelectCommand.Parameters.AddWithValue("@DeptID", ID) |
| adapter.Fill(dt) |
| End If |
| Return dt |
| End Function |
| Protected Sub AddBlankItemtoCombo(ByVal i As Object) |
| Dim blankItem As New RadComboBoxItem() |
| blankItem.Height = CType(10, Unit) |
| i.Items.Insert(0, blankItem) |
| End Sub |
| Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound |
| If TypeOf e.Item Is GridFilteringItem Then |
| Dim filter As GridFilteringItem = DirectCast(e.Item, GridFilteringItem) |
| Dim DeptID As RadComboBox = DirectCast(filter.FindControl("DeptID"), RadComboBox) |
| Dim EmployeeID As RadComboBox = DirectCast(filter.FindControl("EmployeeID"), RadComboBox) |
| If Not IsPostBack Then |
| If Session("DeptID") IsNot Nothing Then |
| DeptID.SelectedValue = Session("DeptID") |
| EmployeeID.DataSource = LoadUnitID(DeptID.SelectedValue) |
| EmployeeID.DataBind() |
| AddBlankItemtoCombo(EmployeeID) |
| End If |
| Dim columnID As GridColumn = RadGrid1.MasterTableView.GetColumnSafe("DeptID") |
| columnID.CurrentFilterValue = DeptID.SelectedValue |
| End If |
| End If |
| End Sub |
protected void RadGrid1_PreRender(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
RadGrid1.MasterTableView.FilterExpression =
"([disabled_ind] LIKE \'%N%\')";
GridColumn column = RadGrid1.MasterTableView.GetColumnSafe("disabled_ind");
column.CurrentFilterFunction =
GridKnownFunction.Contains;
column.CurrentFilterValue =
"N";
RadGrid1.MasterTableView.Rebind();
}
}
I'm using a SqlDataSource didn't know if this might be an issue. Any help would be greatly appreciated because I keep getting the error "Expression needed" when its exactly as the documentation and tutorials say.
| <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head runat="server"> |
| <title> |
| </title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager id="RadScriptManager1" runat="server" __designer:wfdid="w3"> |
| </telerik:RadScriptManager> |
| <telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" __designer:wfdid="w6" Skin="Default" Runat="server" Transparency="50" MinDisplayTime="3">Loading....?</telerik:RadAjaxLoadingPanel> |
| <DIV> |
| <telerik:RadGrid id="RadGrid1" runat="server" __designer:wfdid="w1" DataSourceID="SqlDataSource1" GridLines="None" ShowStatusBar="True" AllowPaging="True" AllowSorting="True" ShowGroupPanel="True"> |
| <PagerStyle PageButtonCount="15" Position="TopAndBottom" AlwaysVisible="True"></PagerStyle> |
| <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="True"> |
| <PagerStyle AlwaysVisible="True"></PagerStyle> |
| </MasterTableView> |
| <GroupingSettings ShowUnGroupButton="True"></GroupingSettings> |
| </telerik:RadGrid> |
| <asp:SqlDataSource id="SqlDataSource1" runat="server" __designer:wfdid="w2" |
| ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>" |
| ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>" |
| SelectCommand="select * from testtbl where rownum < 30"></asp:SqlDataSource> |
| </DIV> |
| <telerik:RadAjaxManager id="RadAjaxManager1" runat="server" __designer:wfdid="w4" |
| DefaultLoadingPanelID="RadAjaxLoadingPanel1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> </form></body></html> |
| <httpHandlers> |
| <remove verb="*" path="*.asmx" /> |
| <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
| <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
| <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
| <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> |
| <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" /> |
| </httpHandlers> |
| <%@ Register TagPrefix="ignav" Namespace="Infragistics.WebUI.UltraWebNavigator" Assembly="Infragistics.WebUI.UltraWebNavigator.v3" %> |
| <%@ Control Language="vb" AutoEventWireup="false" Codebehind="Navigation-Menu.ascx.vb" Inherits="CSC.CorporateAdvisor.Web.Navigation_Menu" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" enableViewState="False"%> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <%--<link href ="../Menu.Default.css" type="text/css" rel="Stylesheet"/>--%> |
| <link href ="../ProjectStyles.css" type="text/css" rel="Stylesheet"/> |
| <ignav:ultrawebmenu id="UltraWebMenu1" runat="server" SubMenuImage="../ig_common/WebNavigator3/ig_menuTri.gif" |
| CompactRendering="False" ScrollImageTop="../ig_common/WebNavigator3/ig_menu_scrollup.gif" DefaultItemClass="MenuItemClass" |
| ItemSpacingTop="0" ScrollImageBottomDisabled="../ig_common/WebNavigator3/ig_menu_scrolldown_disabled.gif" |
| HoverClass="MenuHoverClass" DefaultIslandClass="MenuIslandClass" ScrollImageTopDisabled="../ig_common/WebNavigator3/ig_menu_scrollup_disabled.gif" |
| DisabledClass="MenuDisabledClass" FileUrl=" " ScrollImageBottom="../ig_common/WebNavigator3/ig_menu_scrolldown.gif" |
| SeparatorClass="SeparatorClass" Width="417px" TopAligment="Center" RenderAnchors="False"> |
| <Styles> |
| <ignav:Style Cursor="hand" CssClass="MenuIslandClass"></ignav:Style> |
| <ignav:Style Cursor="hand" CssClass="MenuBarClass"></ignav:Style> |
| <ignav:Style Cursor="hand" CssClass="MenuBarLastClass"></ignav:Style> |
| <ignav:Style Cursor="hand" CssClass="MenuHoverClass"></ignav:Style> |
| <ignav:Style BackgroundImage="ig_menuStandardSep.gif" CssClass="SeparatorClass" CustomRules="background-repeat:repeat-x; "></ignav:Style> |
| <ignav:Style ForeColor="LightGray" CssClass="MenuDisabledClass"></ignav:Style> |
| <ignav:Style CssClass="MenuItemClass"></ignav:Style> |
| <ignav:Style CssClass="MenuItemHoverClass"></ignav:Style> |
| </Styles> |
| <ExpandEffects ShadowColor="DarkGray" Type="Fade"></ExpandEffects> |
| <Levels> |
| <ignav:Level LevelClass="MenuBarClass" Index="0" LevelCheckBoxes="False"></ignav:Level> |
| <ignav:Level LevelHoverClass="MenuItemHoverClass" Index="1" LevelCheckBoxes="False"></ignav:Level> |
| </Levels> |
| </ignav:ultrawebmenu> |
| <telerik:RadScriptManager ID="ScriptManager" runat="server"/> |
| <telerik:RadMenu runat="server" id="MENUK" style="float: right" |
| EnableShadows="true" EnableRoundedCorners="false" |
| EnableEmbeddedSkins="false" BorderStyle="None" |
| Font-Bold="false" CssClass="rmItem" |
| > |
| </telerik:RadMenu> |
| <input type="hidden" name="hidMenuId" id="hidMenuId" value=""> |
| Private Sub RadAsyncUpload1_FileUploaded(ByVal sender As Object, ByVal e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded |
| objCon = New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("HDSWebConnectionString").ConnectionString) |
| objCon.Open() |
| For Each file As UploadedFile In RadUpload1.UploadedFiles |
| Dim bytes(file.InputStream.Length - 1) As Byte |
| file.InputStream.Read(bytes, 0, file.InputStream.Length) |
| Try |
| Dim command As New SqlCommand("insert into Images (Description,ImageData,ImagePath,Caption ) " & _ |
| "values ('','@Content','',''); SELECT @@IDENTITY", objCon) |
| command.Parameters.AddWithValue("@Content", bytes) |
| command.ExecuteNonQuery() |
| Finally |
| End Try |
| Next |
| 'objCon = New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("HDSWebConnectionString").ConnectionString) |
| 'objCon.Open() |
| 'For Each file As UploadedFile In RadAsyncUpload1.UploadedFiles |
| ' Dim bytes(file.InputStream.Length - 1) As Byte |
| ' file.InputStream.Read(bytes, 0, file.InputStream.Length) |
| ' Try |
| ' Dim strfn As String = "C:\Users\jcrumpton\Documents\Test.jpg" |
| ' Dim fs As New FileStream(strfn, FileMode.CreateNew, FileAccess.Write) |
| ' fs.Write(bytes, 0, file.InputStream.Length) |
| ' fs.Flush() |
| ' fs.Close() |
| ' Finally |
| ' End Try |
| 'Next |
| End Sub |