or
Imports
System.Data.SqlClient
Public
Class
Form1
Private
_dvNames_List
As
New
DataView
Private
Sub
Button1_Click(sender
As
System.
Object
, e
As
System.EventArgs)
Handles
Button1.Click
Dim
sSQLConnection
As
String
=
"MYSQLCONNECTION"
Dim
oConn
As
New
SqlConnection(sSQLConnection)
Dim
oCommand
As
New
SqlCommand
Dim
oDT
As
New
DataTable
Dim
oDA
As
SqlDataAdapter
Try
oConn.Open()
With
oCommand
.Connection = oConn
.CommandTimeout = 15
.CommandType = CommandType.StoredProcedure
.CommandText =
"cp_MyStoredProc"
End
With
oDA =
New
SqlDataAdapter(oCommand)
oDA.Fill(oDT)
oDT.TableName =
"SQLDATATABLE"
_dvNames_List.Table = oDT
Catch
ex
As
Exception
Throw
New
Exception(ex.Message, ex)
End
Try
End
Sub
Private
Sub
Form1_Load(sender
As
Object
, e
As
System.EventArgs)
Handles
Me
.Load
RadDropDownList1.ValueMember =
"nameid"
RadDropDownList1.DisplayMember =
"name"
RadDropDownList1.DataSource = _dvNames_List
End
Sub
End
Class