Link to home
Start Free TrialLog in
Avatar of Sirdots
Sirdots

asked on

passing the result of a stored procedure to a datatable


I am running  a stored procedure and will like to pass the result to a datatable. How can I achieve this please. The code below here  is giving me errors.

Thanks.


private DataTable GetSelectCare()
        {
            DataTable dtselectCare = null;
            try
            {
                dtselectCare = new DataTable();
                occom.CommandText = "DispSelectCare";
                occom.CommandType = CommandType.StoredProcedure;
                dtselectCare = occom.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
            return dtselectCare;
        }
ASKER CERTIFIED SOLUTION
Avatar of existenz2
existenz2
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial