Hi, I have a class called Jobs. In that class is the function below..
Public Function GetJobTitle(ByVal Job_Title_ID As Integer, ByVal Company_ID
As Integer) As DataSet
' Setup the Stored Procedure
Dim SqlCommand As New SqlCommand
Dim SqlConnection As New SqlConnection(DataLayer.ConnectionString)
Try
SqlCommand.CommandText = "dbo.DeleteJobTitle"
SqlCommand.CommandType = System.Data.CommandType.StoredProcedure
SqlCommand.Connection = SqlConnection
' Load the Parameters
SqlCommand.Parameters.Add(New
System.Data.SqlClient.SqlParameter("RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
SqlCommand.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Job_Title_ID" ,
System.Data.SqlDbType.Int, 4)).Value = Job_Title_ID
SqlCommand.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Company_ID", System.Data.SqlDbType.Int,
4)).Value = Company_ID
' Fire the Procedure
SqlConnection.Open()
' Create a dataset
Dim da As SqlDataAdapter = New SqlDataAdapter
da.SelectCommand = SqlCommand
Dim ds As New DataSet
da.Fill(ds, "JobTitle")
Return ds
Catch ex As Exception
Throw New Exception(ex.ToString)
Finally
SqlConnection.Close()
End Try
End Function
I now have a web form called Default.aspx
How can I poplulate a Datagrid or Select box from the above function?
Datagrid1.Datasource = jobs.GetJobTitle(1,1) ???
Please help
Thanks Daren