How to retrieve data from oracle database to Visual Studio -2005 asp.net grid view?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • michaelTun

    How to retrieve data from oracle database to Visual Studio -2005 asp.net grid view?

    how can I retrieve data from oracle database to Visual Studio -2005 asp.net grid view.

    Code:
    connection.Open()
    
     
    string sql = "select * from departments where department_id < 60"
    cmd = new OracleCommand(sql, conn)
    cmd.CommandType = CommandType.Text;
    
    da = new OracleDataAdapter(cmd)
    cb = new OracleCommandBuilder(da)
    ds = new DataSet()
     
    da.Fill(ds)
     
    gridname.DataSource = ds.Tables[0]
    I use above coding but no data show in grid and also no error found.

    Thanks,
    MichaelTun
Working...