aspx.vb
Protected Sub ItemsRequested(ByVal o As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) Handles RCBClient.ItemsRequested
Try
RCBClient.Items.Clear()
Dim selectCommand As New SqlCommand("GetClients", myConnection)
selectCommand.CommandType = CommandType.StoredProcedure
selectCommand.Parameters.AddWithValue(
"@CN", e.Text)
Dim adapter As New SqlDataAdapter(selectCommand)
Dim DT As New DataTable()
adapter.Fill(DT)
RCBClient.DataTextField =
"Client"
RCBClient.DataValueField =
"ClientID"
RCBClient.DataSource = DT
RCBClient.DataBind()
Catch
End Try
End Sub
Protected Sub btnLoad_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLoad.Click
Using selectCommand As New SqlCommand("CreateClient", myConnection)
selectCommand.CommandType = CommandType.StoredProcedure
selectCommand.Parameters.AddWithValue(
"@CN", RCBClient.Text)
myConnection.Open()
Using reader As SqlDataReader = selectCommand.ExecuteReader
While reader.Read
Build_CustomerRep(reader(
"CID"))
Build_Facility(reader(
"CID"))
End While
End Using
myConnection.Close()
End Using
End Sub
.aspx
<tr><td>Client:</td>
<td><Telerik:RadComboBox ID="RCBClient" EnableEmbeddedSkins="false" Skin="Default" runat="server" ShowMoreResultsBox="False" EnableLoadOnDemand="True" OnItemsRequested="ItemsRequested" AutoPostBack="true" >
<CollapseAnimation Type="OutExpo" Duration="200"></CollapseAnimation>
</Telerik:RadComboBox>
</td>
<td><asp:Button runat="server" ID="btnLoad" Text="Create New" /></td>
</tr>
Error:
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074