Oracle data retrive via C# application - ASP.net/ Oracle
internal static DataTable getAutoCADDrawings()
{ DataTable dtTable = new DataTable();
dtTable = null;
try
{
Database db = DatabaseFactory.CreateDatabase("oracle_db");
string oraCommand = "SELECT SD.SITEID," +
" (SELECT SITENAME FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) as SITENAME ," +
" (SELECT SITEOWNER FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) as SITEOWNER ," +
" (SELECT SITETYPE FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS SITETYPE ," +
" (SELECT DISTRICT FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS DISTRICT ," +
" (SELECT PROVINCE FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS REGION ," +
" (SELECT STATUSS FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS SITESTATUS ," +
"SD.DOCUMENTTYPE AS DOCTYPE ,SD.DOCUMENTNAME AS DOCNAME ,SD.DOCUMENTNAME AS REMARKS ," +
"SD.CREATEDBY AS CREATEDBY,TO_CHAR(SD.RECORDCREATEDDATE,'dd-Mon-yyyy') AS CREATEDDATE ," +
"SD.EDITEDBY AS UPDATEDBY,TO_CHAR(SD.RECORDUPDATEDDATE,'dd-Mon-yyyy')AS UPDATEDDATE " +
"FROM SITEDOCUMENTS SD "+
"WHERE LOWER(FILEEXTEN) in ('dwg','bak','dwt','dwf') ";
OracleCommand ora = new OracleCommand(oraCommand);
dtTable = db.ExecuteDataSet(ora).Tables[0];
}
catch (Exception ex)
{
}
return dtTable;
}
{ DataTable dtTable = new DataTable();
dtTable = null;
try
{
Database db = DatabaseFactory.CreateDatabase("oracle_db");
string oraCommand = "SELECT SD.SITEID," +
" (SELECT SITENAME FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) as SITENAME ," +
" (SELECT SITEOWNER FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) as SITEOWNER ," +
" (SELECT SITETYPE FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS SITETYPE ," +
" (SELECT DISTRICT FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS DISTRICT ," +
" (SELECT PROVINCE FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS REGION ," +
" (SELECT STATUSS FROM SITEGENERALDETAIL WHERE SITEID=SD.SITEID) AS SITESTATUS ," +
"SD.DOCUMENTTYPE AS DOCTYPE ,SD.DOCUMENTNAME AS DOCNAME ,SD.DOCUMENTNAME AS REMARKS ," +
"SD.CREATEDBY AS CREATEDBY,TO_CHAR(SD.RECORDCREATEDDATE,'dd-Mon-yyyy') AS CREATEDDATE ," +
"SD.EDITEDBY AS UPDATEDBY,TO_CHAR(SD.RECORDUPDATEDDATE,'dd-Mon-yyyy')AS UPDATEDDATE " +
"FROM SITEDOCUMENTS SD "+
"WHERE LOWER(FILEEXTEN) in ('dwg','bak','dwt','dwf') ";
OracleCommand ora = new OracleCommand(oraCommand);
dtTable = db.ExecuteDataSet(ora).Tables[0];
}
catch (Exception ex)
{
}
return dtTable;
}
Comments
Post a Comment