Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP.NET Datagrid Problem

Member
 
Join Date: Nov 2006
Posts: 40
#1: Dec 5 '06
Hi
I am fetching the data in a datagrid from Oracle DB. At some places the data is not correct. Like if it's ASH in DB then only AS is displayed in the datagrid. I hope I am using the correct code. Below is the code I am using:
Dim con As New OracleConnection("Password=a;" & _
"User ID=opd;Data Source=bkp;")
Dim dataset As New DataSet()
Dim str As String
con.Open()
str = "select substr(from_date,1,9) as START_DATE,substr(end_date,1,9) as END_DATE ,leave_days,substr(sanctioned_by,1,3) as SANCTIONED_BY,substr(date_of_application,1,9) as Application_date from detail_leave where emp_code='" + empcode.Text + "' and leave_type='" + type.SelectedItem.Text + "'"
Dim dataadapter As New OracleDataAdapter(str, con)
dataadapter.Fill(dataset)
dg.DataSource = dataset
dg.DataBind()
con.Close()

Pls Help me out.

Regards,
Ashima

Newbie
 
Join Date: Dec 2006
Location: Mauritius
Posts: 2
#2: Dec 5 '06

re: ASP.NET Datagrid Problem


Hello,

First thing is to check if the query brings you the data as it should be, then you should check the width that you have placed on your datagrid to see if no cropping occurs.

Quote:

Originally Posted by ashima515

Hi
I am fetching the data in a datagrid from Oracle DB. At some places the data is not correct. Like if it's ASH in DB then only AS is displayed in the datagrid. I hope I am using the correct code. Below is the code I am using:
Dim con As New OracleConnection("Password=a;" & _
"User ID=opd;Data Source=bkp;")
Dim dataset As New DataSet()
Dim str As String
con.Open()
str = "select substr(from_date,1,9) as START_DATE,substr(end_date,1,9) as END_DATE ,leave_days,substr(sanctioned_by,1,3) as SANCTIONED_BY,substr(date_of_application,1,9) as Application_date from detail_leave where emp_code='" + empcode.Text + "' and leave_type='" + type.SelectedItem.Text + "'"
Dim dataadapter As New OracleDataAdapter(str, con)
dataadapter.Fill(dataset)
dg.DataSource = dataset
dg.DataBind()
con.Close()

Pls Help me out.

Regards,
Ashima

Reply