prem_rajani
Member
Hi,
How to populate datagrid with values got from oracle stored procedure. When I bind datagrid nothing seems to be displayed. The code is as follows:
The procedure is as follows:
Can anyone help me out pls?
Note: Datagrid doesnt get populated
How to populate datagrid with values got from oracle stored procedure. When I bind datagrid nothing seems to be displayed. The code is as follows:
VB.NET:
[SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmdQuery [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbCommand(trvSP.SelectedNode.Text, OleConn)
cmdQuery.CommandType = CommandType.StoredProcedure
[/SIZE][SIZE=2]'This if no parameters[/SIZE][SIZE=2][COLOR=#0000ff][/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] daQuery [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbDataAdapter(cmdQuery)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] dsQuery [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet
daQuery.Fill(dsQuery)
dgResult.DataSource = dsQuery
[/SIZE][SIZE=2]
'If parameters exist
strsplit = Split(rtbParam.Text, ",")
[/SIZE][SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][SIZE=2] I = 0 [/SIZE][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][SIZE=2] ParamList.Count - 1
cmdQuery.Parameters.Add(ParamList.Item(I), strsplit(I))
[/SIZE][SIZE=2][COLOR=#0000ff]Next
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] daQuery [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] OleDbDataAdapter(cmdQuery)
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] dsQuery [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DataSet
daQuery.Fill(dsQuery)
dgResult.DataSource = dsQuery
[/SIZE]
The procedure is as follows:
VB.NET:
create procedure Users (
username varchar2,user out varchar2)
as
name varchar2(10);
pwd varchar2(10);
begin
select username ,userpass into name,pwd from CC_M_USERPREV_H
where username=username;
--dbms_output.put_line(name);
--dbms_output.put_line(pwd);
end;
Can anyone help me out pls?
Note: Datagrid doesnt get populated