View Single Post

   
  #4 (permalink)  
Old 02-28-2008, 08:08 PM
Dan Guzman
 
Posts: n/a
Default Re: Database Permission

I ran your code and got the "Exception3" message. What symptoms are you
getting?

--
Hope this helps.

Dan Guzman
SQL Server MVP


"Julie Barnet" <barnetj@pr.fraserpapers.com> wrote in message
news:438e1811.0312090444.3e7dd4ab@posting.google.c om...
> I am databinding a datagrid. I tried that and it still doesn't seem
> to work. I will paste my code...
>
> Is there something I'm missing?
>
> Public Function BindGrid(ProcName as String, myDataGrid as
> DataGrid, cmd as SqlCommand, con as SqlConnection) as Integer
> Dim ds As DataSet
> Dim da As new SqlDataAdapter()
>
> Try
>
> cmd.CommandText = ProcName
> cmd.CommandType = CommandType.StoredProcedure
> cmd.Connection = con
>
> da.Selectcommand = cmd
>
> ds = new DataSet()
> da.Fill(ds, "MyTable")
>
> myDataGrid.DataSource=ds.Tables("MyTable").Default View
> myDataGrid.DataBind()
> return ds.Tables("MyTable").Rows.Count
>
>
> catch exp as SqlException
> HttpContext.Current.Response.Write("Exception3")
>
> End Try
> End Function



Reply With Quote