The piece of code you posted looks okay. If there's a problem, the cause must be in other section of the code. Try posting the full code (both aspx and code-behind).
One of the most common fault of posters asking questions is that they tend to hand-feed pieces of code they think are pertinent while the real problem lies elsewhere. What you've posted thus are are all okay. If not, chances are you would have found the problem
already. Unless you post the full source showing where and how you are defining and referencing the DataGrid control, no one can guess what's going on. In addition, posting the full error message is invaluable as well.
However, Posting the complete code is almost impractical because certain pages you cannot understand easily. There are massive links and database access codes everywhere. That is why I tend to just display the relevant code.
The steps were so simple. Just drag a DataGrid onto the form. Rename itsID. You get the error.
Here is the code anywy.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.OleDb;
using TextConverter;
public partial class WF_Home : System.Web.UI.Page
{
string fstr_clientid;
string fstr_userid;
string fstr_category;
Cls_DataAccessManager Cls_DManager = new Cls_DataAccessManager();
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
SqlDataAdapter CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_divn FROM tbl_pl_platform_details WHERE lng_clientid=" + str_clientid + " ORDER BY str_divn", CAIRS_DataConnection);
DataSet CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Group.Items.Clear();
this.DropDownList_Group.Items.Add("All");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Group.Items.Add(row.ItemArray.GetValue(0).ToString());
}
//===============================================================================
Populate_Facilities("","");
//CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_pstrname FROM tbl_pl_platform_details WHERE lng_clientid=" + str_clientid + " ORDER BY str_pstrname", CAIRS_DataConnection);
//CAIRS_DataSet = new DataSet();
//CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
//this.DropDownList_Facility.Items.Clear();
//this.DropDownList_Facility.Items.Add("All");
//foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
//{
// this.DropDownList_Facility.Items.Add(row.ItemArray.GetValue(0).ToString());
//}
//===============================================================================
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT int_inspect_year FROM tbl_ge_inspection WHERE lng_clientid=" + str_clientid + " ORDER BY int_inspect_year desc", CAIRS_DataConnection);
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
}
public System.Data.DataSet GetData(string SQLCommand)
{
try
{
//Get the connection string from the web.config file, changing it there won't require a new compile.
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
System.Data.SqlClient.SqlConnection conn = new SqlConnection(ConnString);
System.Data.SqlClient.SqlDataAdapter da = new SqlDataAdapter(SQLCommand,conn);
System.Data.DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
catch (System.Exception ex)
{
Response.Write(ex.Message); //I usually log my errors in a text file or the database.
return null;
}
}
private void ShowFilteredData(OleDbDataReader myDataReader)
{
//string Query = "SELECT * FROM dbo.view_platform_tbl_ge_inspection ";
//String.Format is a much faster way to concatnate strings.
//Query += String.Format("WHERE lng_clientid = {0} AND str_inspect_no = '{1}'", this.cboClient.SelectedValue, this.cboYear.SelectedValue);
str_SQL1 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_topside.str_inspname AS Inspection," +
" tbl_pl_topside.str_item AS Item,tbl_pl_topside.str_itemdsc AS [Item Desc.],tbl_pl_topside.str_comment_structure AS [Structural Comments]," +
" tbl_pl_topside.str_struc_cond AS [Structural Condition], tbl_pl_topside.str_struc_rate AS [Structural Rating],tbl_pl_topside.str_struc_dmg AS [Structural Damage]," +
" tbl_pl_topside.str_anomaly_status_struct AS [Anomaly Status],tbl_pl_topside.int_status_priority_struct AS Priority," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_topside ON chld.lng_detail_id = tbl_pl_topside.lng_id AND tbl_pl_topside.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_topside.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_topside') AND (chld.str_anomaly_category = 'Level 1 Structural Condition Is Rated Bad')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL2 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_topside.str_inspname AS Inspection," +
" tbl_pl_topside.str_item AS Item,tbl_pl_topside.str_itemdsc AS [Item Desc.],tbl_pl_topside.str_comment_coating AS [Coating Comments]," +
" tbl_pl_topside.str_coat_cond AS [Coating Condition], tbl_pl_topside.str_coat_rate AS [Coating Rating],tbl_pl_topside.str_coat_dmg AS [Coating Damage]," +
" tbl_pl_topside.str_anomaly_status_coat AS [Anomaly Status],tbl_pl_topside.int_status_priority_coat AS Priority," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_topside ON chld.lng_detail_id = tbl_pl_topside.lng_id AND tbl_pl_topside.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_topside.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_topside') AND (chld.str_anomaly_category = 'Level 1 Coating Condition Is Bad')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL3 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_anomaly.str_inspname as Inspection," +
" tbl_pl_anomaly.str_itemdsc as Item," +
" tbl_pl_anomaly.str_type as Type,tbl_pl_anomaly.str_anomaly_status as [Anomaly Status],tbl_pl_anomaly.str_comment as Comments, tbl_pl_anomaly.str_anomalyid as [Anomaly No.], tbl_pl_anomaly.int_dim_1_eng as Length," +
" tbl_pl_anomaly.int_dim_2_eng as Width,tbl_pl_anomaly.int_dim_3_eng as Depth," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_anomaly ON chld.lng_detail_id = tbl_pl_anomaly.lng_id AND tbl_pl_anomaly.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_anomaly.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_anomaly') AND (chld.str_anomaly_category = 'Platform Structural Anomalies')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL4 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment as Segment, tbl_pl_riser.str_anomaly_status_riser as [Anomaly Status],tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as [Riser Diameter]," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL5 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.lng_id,tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment as Segment, tbl_pl_riser.str_anomaly_status_coat as [Anomaly Status], tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as Diameter," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Coating Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL6 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment, tbl_pl_riser.str_anomaly_status_pipeline as [Anomaly Status],tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as Diameter," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Pipeline Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL7 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn AS [Group]," +
" tbl_pl_clamp.str_inspname as Inspection, tbl_pl_riser.str_item AS Item,tbl_pl_clamp.str_item as [Clamp No.]," +
" tbl_pl_clamp.str_anomaly_status as [Anomaly Status], tbl_pl_clamp.str_clamp_type as [Clamp Type], tbl_pl_clamp.str_comment as Comments," +
" tbl_pl_clamp.int_depth1_eng as Depth, " +
" tbl_pl_clamp.int_r_bolt_exp as [Riser Bolt Exp.],tbl_pl_clamp.int_r_bolt_mis as [Riser Bolt Missing]," +
" tbl_pl_clamp.int_r_gap_eng as [Riser Gap],tbl_pl_clamp.int_s_bolt_exp as [Structure Bolt Exp.]," +
" tbl_pl_clamp.int_s_bolt_mis as [Structure Bolt Missing],tbl_pl_clamp.int_s_gap_eng as [Structure Gap]," +
" usr.str_last AS [Last Name],tbl_pl_riser.str_item,tbl_pl_riser.str_itemdsc" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_clamp ON chld.lng_detail_id = tbl_pl_clamp.lng_id AND tbl_pl_clamp.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_clamp.str_inspname, 1, 8) INNER JOIN" +
" tbl_pl_riser ON tbl_pl_clamp.lng_clientid = tbl_pl_riser.lng_clientid AND" +
" tbl_pl_clamp.lng_riserid = tbl_pl_riser.lng_id RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_clamp') AND (chld.str_anomaly_category = 'Riser Clamp Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
break;
default:
//* -Platform Structure Bad */
str_SQL1 = "SELECT web_view_platform_tbl_pl_topside.lng_id,web_view_platform_tbl_pl_topside.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_topside.str_itemdsc as [Item Desc]," +
" web_view_platform_tbl_pl_topside.str_item as Item, web_view_platform_tbl_pl_topside.str_anomaly_status_struct as [Anomaly Status], web_view_platform_tbl_pl_topside.str_comment_structure as Comments," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_topside ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_topside.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_topside.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_topside'" +
" WHERE ( web_view_platform_tbl_pl_topside.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_topside.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_topside.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_topside.str_struc_dmg = 'YES') AND" +
"( web_view_platform_tbl_pl_topside.str_struc_cond = 'BAD') AND ( web_view_platform_tbl_pl_topside.int_insp_year <> 9200)" +
" ORDER BY web_view_platform_tbl_pl_topside.str_insp_pstrname, web_view_platform_tbl_pl_topside.lng_id" ;
//* -Platform Coating Bad */
str_SQL2 = "SELECT " +
" web_view_platform_tbl_pl_topside.lng_id,web_view_platform_tbl_pl_topside.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_topside.str_itemdsc as [Item Desc], web_view_platform_tbl_pl_topside.str_item as Item, " +
" web_view_platform_tbl_pl_topside.str_anomaly_status_coat as [Anomaly Status]," +
" web_view_platform_tbl_pl_topside.str_comment_coating as Comments," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_topside ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_topside.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_topside.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_topside'" +
" WHERE ( web_view_platform_tbl_pl_topside.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_topside.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_topside.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_topside.int_insp_year <> 9200) AND" +
"(UPPER( web_view_platform_tbl_pl_topside.str_coat_dmg) = 'YES') AND ( web_view_platform_tbl_pl_topside.str_coat_cond = 'BAD' OR ltrim(rtrim( web_view_platform_tbl_pl_topside.str_coat_cond)) = 'C')" +
" ORDER BY web_view_platform_tbl_pl_topside.str_insp_pstrname, web_view_platform_tbl_pl_topside.lng_id";
//* '-Platform Structural anomaly */
str_SQL3 = "SELECT web_view_platform_tbl_pl_anomaly.lng_id, web_view_platform_tbl_pl_anomaly.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_anomaly.str_itemdsc as Item," +
" web_view_platform_tbl_pl_anomaly.str_type as Type,web_view_platform_tbl_pl_anomaly.str_anomaly_status as [Anomaly Status],web_view_platform_tbl_pl_anomaly.str_comment as Comments, web_view_platform_tbl_pl_anomaly.str_anomalyid
as [Anomaly No.], web_view_platform_tbl_pl_anomaly.int_dim_1_eng as Length," +
" web_view_platform_tbl_pl_anomaly.int_dim_2_eng as Width, web_view_platform_tbl_pl_anomaly.int_dim_3_eng as Depth," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], tbl_ge_media_log.str_photodrawvideo AS [Image Type] " +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_anomaly ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_anomaly.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_anomaly.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_pl_anomaly'" +
" WHERE ( web_view_platform_tbl_pl_anomaly.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_anomaly.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_anomaly.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_anomaly.int_insp_year <> 9200) AND" +
" upper ( web_view_platform_tbl_pl_anomaly.str_anomaly_status) <> 'CLEARED'" +
" ORDER BY web_view_platform_tbl_pl_anomaly.str_insp_pstrname, web_view_platform_tbl_pl_anomaly.lng_id";
//* '-Riser Damage */
str_SQL4 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment as Segment, web_view_platform_tbl_pl_riser.str_anomaly_status_riser as [Anomaly Status],web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as [Riser Diameter]," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tb_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_riser_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Coating Anomaly */
str_SQL5 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment as Segment, web_view_platform_tbl_pl_riser.str_anomaly_status_coat as [Anomaly Status], web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as Diameter," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_coat_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Pipeline Anomaly */
str_SQL6 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment, web_view_platform_tbl_pl_riser.str_anomaly_status_pipeline as [Anomaly Status],web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as Diameter," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_pipe_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Clamp Anomaly */
str_SQL7 = "SELECT web_view_platform_tbl_pl_clamp.lng_id,web_view_platform_tbl_pl_clamp.str_insp_pstrname as Facility, tbl_pl_riser.str_item AS Item,web_view_platform_tbl_pl_clamp.str_item as [Clamp No.]," +
" web_view_platform_tbl_pl_clamp.str_anomaly_status as [Anomaly Status], web_view_platform_tbl_pl_clamp.str_clamp_type as [Clamp Type], web_view_platform_tbl_pl_clamp.str_comment as Comments," +
" web_view_platform_tbl_pl_clamp.int_depth1_eng as Depth, " +
" web_view_platform_tbl_pl_clamp.int_r_bolt_exp as [Riser Bolt Exp.], web_view_platform_tbl_pl_clamp.int_r_bolt_mis as [Riser Bolt Missing]," +
" web_view_platform_tbl_pl_clamp.int_r_gap_eng as [Riser Gap], web_view_platform_tbl_pl_clamp.int_s_bolt_exp as [Structure Bolt Exp.]," +
" web_view_platform_tbl_pl_clamp.int_s_bolt_mis as [Structure Bolt Missing], web_view_platform_tbl_pl_clamp.int_s_gap_eng as [Structure Gap]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_pl_riser INNER JOIN" +
" web_view_platform_tbl_pl_clamp ON tbl_pl_riser.lng_clientid = web_view_platform_tbl_pl_clamp.lng_clientid AND" +
" tbl_pl_riser.lng_id = web_view_platform_tbl_pl_clamp.lng_riserid LEFT OUTER JOIN" +
" tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id ON" +
" web_view_platform_tbl_pl_clamp.lng_clientid = tbl_ge_media_link.lng_clientid AND" +
" web_view_platform_tbl_pl_clamp.lng_id = tbl_ge_media_link.lng_insp_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_clamp'" +
" WHERE ( web_view_platform_tbl_pl_clamp.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_clamp.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_clamp.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_clamp.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_clamp.bln_r_damage = 1) OR" +
"( web_view_platform_tbl_pl_clamp.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_clamp.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_clamp.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_clamp.int_insp_year <> 9200) AND ( web_view_platform_tbl_pl_clamp.bln_s_damage = 1)" +
" ORDER BY web_view_platform_tbl_pl_clamp.str_insp_pstrname, web_view_platform_tbl_pl_clamp.lng_id";
//* LEG CP Riser-JTube Anomalies */
str_SQL8 = "SELECT COUNT(T1.lng_id),T1.str_insp_pstrname as Facility," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS [Number of Readings]" +
" FROM web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND " +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND " +
" web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Number of Readings]," +
" MAX(T1.int_cp_read) AS [Minimum Reading], MIN(T1.int_cp_read) AS [Maximum Reading]," +
" AVG(T1.int_cp_read) AS [Average Reading]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong" +
" From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read < - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Good Readings]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read > - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Bad Readings]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type], dbo.tbl_ge_inspection.lng_id" +
" FROM tbl_ge_media_log INNER JOIN tbl_ge_media_link ON tbl_ge_media_log.lng_id = tbl_ge_media_link.lng_media_id AND" +
" tbl_ge_media_log.lng_clientid = tbl_ge_media_link.lng_clientid AND tbl_ge_media_log.str_photodrawvideo = 'DRAWING' AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection' RIGHT OUTER JOIN" +
" web_view_platform_tbl_ge_cp_read T1 INNER JOIN tbl_ge_inspection ON T1.str_insp_pstrname = tbl_ge_inspection.str_pstrname AND T1.lng_clientid = tbl_ge_inspection.lng_clientid AND" +
" tbl_ge_inspection.str_inspect_type = '" + pstr_anomaly_type + "' AND tbl_ge_inspection.int_inspect_year = " + pstr_year + " ON tbl_ge_media_link.lng_clientid = tbl_ge_inspection.lng_clientid AND tbl_ge_media_link.lng_insp_id
= tbl_ge_inspection.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" WHERE (T1.lng_clientid = " + fstr_clientid + ") AND (T1.int_insp_year = " + pstr_year + ") AND (T1.str_insp_type = '" + pstr_anomaly_type + "') AND (T1.str_itemdsc = 'LEG') AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" GROUP BY T1.str_insp_pstrname, tbl_ge_inspection.str_pstrname, tbl_ge_media_link.str_insp_tabl, dbo.tbl_ge_media_log.str_caption, tbl_ge_media_log.str_image," +
" dbo.tbl_ge_media_log.str_photodrawvideo, tbl_ge_inspection.lng_id" +
" ORDER BY T1.str_insp_pstrname";
//* CP Riser-JTube Anomalies */
str_SQL9 = "SELECT COUNT(T1.lng_id), T1.str_insp_pstrname as Facility," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS [Number of Readings]" +
" FROM web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND " +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND " +
" web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Number of Readings]," +
" MAX(T1.int_cp_read) AS [Minimum Reading], MIN(T1.int_cp_read) AS [Maximum Reading]," +
" AVG(T1.int_cp_read) AS [Average Reading]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong" +
" From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read < - 800 AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND (web_view_platform_tbl_ge_cp_read.str_itemdsc
= 'RISER' OR web_view_platform_tbl_ge_cp_read.str_itemdsc = 'J-TUBE')) AS [Good Readings]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type
+ "' AND int_cp_read > - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND (web_view_platform_tbl_ge_cp_read.str_itemdsc = 'RISER' OR web_view_platform_tbl_ge_cp_read.str_itemdsc = 'J-TUBE'))
AS [Bad Readings]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type], dbo.tbl_ge_inspection.lng_id" +
" FROM tbl_ge_media_log INNER JOIN" +
" tbl_ge_media_link ON tbl_ge_media_log.lng_id = tbl_ge_media_link.lng_media_id AND tbl_ge_media_log.lng_clientid = tbl_ge_media_link.lng_clientid AND tbl_ge_media_log.str_photodrawvideo = 'DRAWING' AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection' RIGHT OUTER JOIN web_view_platform_tbl_ge_cp_read T1 INNER JOIN" +
" tbl_ge_inspection ON T1.str_insp_pstrname = tbl_ge_inspection.str_pstrname AND T1.lng_clientid = tbl_ge_inspection.lng_clientid AND" +
" tbl_ge_inspection.str_inspect_type = '" + pstr_anomaly_type + "' AND tbl_ge_inspection.int_inspect_year = " + pstr_year + " ON" +
" tbl_ge_media_link.lng_clientid = tbl_ge_inspection.lng_clientid AND tbl_ge_media_link.lng_insp_id = tbl_ge_inspection.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" WHERE (T1.lng_clientid = " + fstr_clientid + ") AND (T1.int_insp_year = " + pstr_year + ") AND (T1.str_insp_type = '" + pstr_anomaly_type + "') AND (T1.str_itemdsc = 'RISER' OR T1.str_itemdsc = 'J-TUBE') AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" GROUP BY T1.str_insp_pstrname, tbl_ge_inspection.str_pstrname, tbl_ge_media_link.str_insp_tabl, dbo.tbl_ge_media_log.str_caption, tbl_ge_media_log.str_image," +
" dbo.tbl_ge_media_log.str_photodrawvideo, tbl_ge_inspection.lng_id" +
" ORDER BY T1.str_insp_pstrname" ;
break;
}
return " ";
}
#region EventHandlers
protected void btnFilter_Click(object sender, System.EventArgs e)
{
//All error checking is done on the form...any additional error checking could be done here before fitering.
ShowFilteredData();
}
private void ShowFilteredData()
{
string Query = "SELECT * FROM dbo.view_platform_tbl_ge_inspection "; //Simple test query.
//String.Format is a much faster way to concatnate strings.
// Query += String.Format("WHERE lng_clientid = {0} AND str_inspect_no = '{1}'", this.cboClient.SelectedValue, this.cboYear.SelectedValue);
private void SetupPage()
{
//Fill the client drop down.
//this.cboClient.DataTextField = "str_client";
//this.cboClient.DataValueField = "lng_id";
// this.cboClient.DataSource = GetData("SELECT TOP 10 * FROM dbo.web_tbl_ge_clients ORDER BY str_client");
//this.cboClient.DataBind();
//this.cboClient.Items.Insert(0, new ListItem("", "")); //Adding a blank entry at the top
//Fill the year drop down. Im going to start at 2000.
for (int Year = 2000; Year <= System.DateTime.Now.Year; Year++)
{
// this.cboYear.Items.Add(new ListItem(Year.ToString(), Year.ToString()));
}
// this.cboYear.Items.Insert(0, new ListItem("", "")); //Adding a blank entry at the top
}
#endregion
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_division FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY str_division", CAIRS_DataConnection);
break;
default:
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_divn FROM tbl_pl_platform_details WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY str_divn", CAIRS_DataConnection);
break;
}
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Group.Items.Add(row.ItemArray.GetValue(0).ToString());
}
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT YEAR(dte_last_inspection)AS insp_year FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY insp_year DESC", CAIRS_DataConnection);
break;
default:
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT int_inspect_year FROM tbl_ge_inspection WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY int_inspect_year desc", CAIRS_DataConnection);
break;
}
//===============================================================================
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Year.Items.Clear();
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Year.Items.Add(row.ItemArray.GetValue(0).ToString());
}
}
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
if ((pStr_selected_group.ToString() == "All") | (pStr_selected_group.ToString() == ""))
{
str_condition = "";
}
else
{
str_condition = " AND str_division='" + pStr_selected_group + "'";
}
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_facility FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + str_condition+ " ORDER BY str_facility", CAIRS_DataConnection);
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
Thanks for posting your code-behind source. Now, can you also post your .aspx as well.
Before you do that, I just had a thought. Can you make sure you didn't use the letter "O" instead of the number "0" when you renamed your DataGrid? Sounds trivial, but many problems usually are.
Welcome, Joey to FOREST OIL CORPORATION's Mechanical Integrity Web Console, there are a total of 5851 items in your Web Database.
</span><span></span></div></td>
</tr>
</table> </td>
<td background="Images/dot_bg_drk_vert.gif" style="width:1px"><img src="Images/spacer.gif" alt="" width="1" height="1" /> </td>
<td align="left" width="50%" valign="top" class="style3">
<table cellpadding="3" cellspacing="3">
<tr><td><span class="style5"> We have reported:</span>
nair7
Member
155 Points
32 Posts
DataGrid; Does not contain definition; error message
Jan 27, 2006 03:20 PM|LINK
I placed a datagrid in web form. Then I renamed the name from 'DataGrid1' to 'DataGrid_01'.
Tthe compiler gives me the following error:
"Does not contain a definition for DataGrid_01"
How come?
jcasp
Star
11540 Points
2286 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 03:46 PM|LINK
What version of VS are you using (2003 or 2005)? Also, check for any reference to DataGrid1 in your code-behind. If not, then post the source code.
nair7
Member
155 Points
32 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 04:01 PM|LINK
I'm using VS 2005.
Here is the definition code.
<asp:DataGrid ID="DataGrid_01" runat="server" Style="left: 246px; position: absolute;
top: 352px" Width="271px">
<AlternatingItemStyle BackColor="Tan" />
</asp:DataGrid>
jcasp
Star
11540 Points
2286 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 04:32 PM|LINK
nair7
Member
155 Points
32 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 04:40 PM|LINK
All what I'm doing in the code-behind section is this:
DataGrid_01.Width=100;
jcasp
Star
11540 Points
2286 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 04:49 PM|LINK
nair7
Member
155 Points
32 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 05:01 PM|LINK
Yes, I understand and agree.
However, Posting the complete code is almost impractical because certain pages you cannot understand easily. There are massive links and database access codes everywhere. That is why I tend to just display the relevant code.
The steps were so simple. Just drag a DataGrid onto the form. Rename itsID. You get the error.
Here is the code anywy.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Data.OleDb;
using TextConverter;
public partial class WF_Home : System.Web.UI.Page
{
string fstr_clientid;
string fstr_userid;
string fstr_category;
Cls_DataAccessManager Cls_DManager = new Cls_DataAccessManager();
protected void Page_Load(object sender, EventArgs e)
{
string str_clientid = (Request.QueryString["ClientID"]);
fstr_clientid = (Request.QueryString["ClientID"]);
fstr_userid = (Request.QueryString["UserID"]);
Cache["ClientID"] = str_clientid;
if (!IsPostBack)
{
this.TextBox_Hidden_Group.Text = "All";
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
SqlDataAdapter CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_divn FROM tbl_pl_platform_details WHERE lng_clientid=" + str_clientid + " ORDER BY str_divn", CAIRS_DataConnection);
DataSet CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Group.Items.Clear();
this.DropDownList_Group.Items.Add("All");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Group.Items.Add(row.ItemArray.GetValue(0).ToString());
}
//===============================================================================
Populate_Facilities("","");
//CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_pstrname FROM tbl_pl_platform_details WHERE lng_clientid=" + str_clientid + " ORDER BY str_pstrname", CAIRS_DataConnection);
//CAIRS_DataSet = new DataSet();
//CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
//this.DropDownList_Facility.Items.Clear();
//this.DropDownList_Facility.Items.Add("All");
//foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
//{
// this.DropDownList_Facility.Items.Add(row.ItemArray.GetValue(0).ToString());
//}
//===============================================================================
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT int_inspect_year FROM tbl_ge_inspection WHERE lng_clientid=" + str_clientid + " ORDER BY int_inspect_year desc", CAIRS_DataConnection);
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Year.Items.Clear();
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Year.Items.Add(row.ItemArray.GetValue(0).ToString());
}
this.DropDownList_Anomaly.Items.Add("All");
this.DropDownList_Anomaly.Items.Add("Structural Bad");
this.DropDownList_Anomaly.Items.Add("Coating Bad");
this.DropDownList_Anomaly.Items.Add("Anomaly");
this.DropDownList_Anomaly.Items.Add("Riser Damage");
this.DropDownList_Anomaly.Items.Add("Riser Coating Damage");
this.DropDownList_Anomaly.Items.Add("Riser Pipeline Damage");
this.DropDownList_Anomaly.Items.Add("Riser Clamp Damage");
this.DropDownList_Anomaly.Items.Add("CP Legs");
this.DropDownList_Anomaly.Items.Add("CP Riser/J-Tube");
}
else
{
//if (SetFocusPostBackControl(this.Page) = "DropDownList_Group")
if (Request.Form ["DropDownList_Group"] != this.TextBox_Hidden_Group.Text)
{
this.TextBox_Hidden_Group.Text = Request.Form["DropDownList_Group"];
}
else
{
this.TextBox_Hidden_Group.Text = Request.Form["DropDownList_Group"];
if (this.DropDownList_Inspection.SelectedValue == "Process")
{
LoadData("EC");
}
else
{
LoadData("");
}
};
}
//this.AdRotator1.AdvertisementFile="Y:\CAIRS V SETUP\Images\" & "Apache" + "\ads.xml";
}
protected void SqlDataSource_Group_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
}
protected void Show_Drawing(string str_lngid)
{
Response.Write("aaa");
Response.End();
}
protected void DropDownList_Inspection_SelectedIndexChanged(object sender, EventArgs e)
{
this.DropDownList_Anomaly.Items.Clear();
if (this.DropDownList_Inspection.SelectedValue == "Process")
{
this.DropDownList_Anomaly.Items.Add("All");
this.DropDownList_Anomaly.Items.Add("Action Item");
this.DropDownList_Anomaly.Items.Add("Caution Item");
Populate_Groups("EC");
Populate_Year("EC");
Populate_Facilities("EC", "All");
}
else
{
Populate_Groups("");
Populate_Year("");
Populate_Facilities("", "All");
}
if (this.DropDownList_Inspection.SelectedValue == "Underwater")
{
this.DropDownList_Anomaly.Items.Add("All");
this.DropDownList_Anomaly.Items.Add("Structural Bad");
this.DropDownList_Anomaly.Items.Add("Coating Bad");
this.DropDownList_Anomaly.Items.Add("Anomaly");
this.DropDownList_Anomaly.Items.Add("Riser Damage");
this.DropDownList_Anomaly.Items.Add("Riser Coating Damage");
this.DropDownList_Anomaly.Items.Add("Riser Pipeline Damage");
this.DropDownList_Anomaly.Items.Add("Riser Clamp Damage");
this.DropDownList_Anomaly.Items.Add("CP Legs");
this.DropDownList_Anomaly.Items.Add("CP Riser/J-Tube");
}
if (this.DropDownList_Inspection.SelectedValue == "Topside")
{
this.DropDownList_Anomaly.Items.Add("All");
this.DropDownList_Anomaly.Items.Add("Structural Bad");
this.DropDownList_Anomaly.Items.Add("Coating Bad");
this.DropDownList_Anomaly.Items.Add("Anomaly");
this.DropDownList_Anomaly.Items.Add("Riser Damage");
this.DropDownList_Anomaly.Items.Add("Riser Coating Damage");
this.DropDownList_Anomaly.Items.Add("Riser Pipeline Damage");
this.DropDownList_Anomaly.Items.Add("Riser Clamp Damage");
this.DropDownList_Anomaly.Items.Add("CP Legs");
this.DropDownList_Anomaly.Items.Add("CP Riser/J-Tube");
}
}
public System.Data.DataSet GetData(string SQLCommand)
{
try
{
//Get the connection string from the web.config file, changing it there won't require a new compile.
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
System.Data.SqlClient.SqlConnection conn = new SqlConnection(ConnString);
System.Data.SqlClient.SqlDataAdapter da = new SqlDataAdapter(SQLCommand,conn);
System.Data.DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
catch (System.Exception ex)
{
Response.Write(ex.Message); //I usually log my errors in a text file or the database.
return null;
}
}
private void ShowFilteredData(OleDbDataReader myDataReader)
{
//string Query = "SELECT * FROM dbo.view_platform_tbl_ge_inspection ";
//String.Format is a much faster way to concatnate strings.
//Query += String.Format("WHERE lng_clientid = {0} AND str_inspect_no = '{1}'", this.cboClient.SelectedValue, this.cboYear.SelectedValue);
//this.grdClientData.DataSource = myDataReader; // GetData(Query);
//this.grdClientData.DataBind();
// this.pnlClientData.Visible = true;
}
protected void DropDownList_Group_SelectedIndexChanged(object sender, EventArgs e)
{
string str_clientid = Cache["ClientID"].ToString();
string str_selected_group = this.DropDownList_Group.Text.ToString().TrimStart().TrimEnd();
if (this.DropDownList_Inspection.SelectedValue == "Process")
{
Populate_Facilities("EC", str_selected_group);
}
else
{
Populate_Facilities("", str_selected_group);
}
}
private string Get_Query_Category(OleDbDataReader myReader) //return string
{
string str_temp = "";
string str_category = "";
for (int i = 0; i < myReader.FieldCount; i++)
{
str_temp = myReader.GetName(i);
if (str_temp.ToLower().TrimStart().TrimEnd() == "str_struc_dmg")
{
str_category = "Structural Bad";
break;
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "str_coat_dmg")
{
str_category = "Coating Bad";
break;
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "str_type")
{
str_category = "Anomaly";
break;
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "int_status_priority_riser")
{
str_category = "Riser Damage";
break;
}
/*"bln_riser_dmg"*/
else if (str_temp.ToLower().TrimStart().TrimEnd() == "int_status_priority_coat")
{
str_category = "Riser Coating Damage";
break;
}
/*"bln_coat_dmg"*/
else if (str_temp.ToLower().TrimStart().TrimEnd() == "int_status_priority_pipeline")
{
str_category = "Riser Pipeline Damage";
break;
/*"bln_pipe_dmg"*/
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "type")
{
str_category = "Riser Clamp Damage";
break;
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "str_pstrname_cp")
{
str_category = "CP Legs";
break;
}
else if (str_temp.ToLower().TrimStart().TrimEnd() == "str_pstrname_jtube")
{
str_category = "CP Riser/J-Tube";
break;
}
//else
// {
// Response.Write (str_temp.ToLower().TrimStart().TrimEnd()) ;
// Response.End();
// }
}//ategory.TrimStart ().TrimEnd ()=="")
return str_category;
}
protected void Menu_Vertical_MenuItemClick(object sender, MenuEventArgs e)
{
switch (e.Item.ValuePath.ToString ())
{
case "Login":
Response.Redirect("WebForm1.aspx");
break;
case "Logout":
Response.Redirect("WebForm1.aspx");
break;
case "User Account/Create Users":
Response.Redirect("WebForm_Users.aspx?ClientID=" + fstr_clientid + "&UserID=" + fstr_userid);
//string sMyURL = @"WebForm_Users.aspx?ClientID=" + fstr_clientid + "&UserID=" + fstr_userid;
//sMyURL = @"http://www.microsoft.com";
//System.Diagnostics.Process.Start(sMyURL);
//System.ComponentModel.Win32Exception: The system cannot find the file specified
//Response.Redirect "AnomalyMain.asp?ClientID=" & lClientID & "&UserID=" & lUserID
//Changed by RK on 01/06/05 for displaying reports in new window.
//var url = "ViewReport.asp?action=sendNotice&path=" + path + "&id=<% = Request.QueryString("id") %>&ClientID=<% = Request.QueryString("ClientID") %>&tbl=<% = Request.QueryString("tbl") %> &UserID=<% = Request.QueryString("UserID") %>"
//if (!win || win.closed){
//win = window.open(url,"","resizable=1,toolbar=0,scrollbars=1");
break;
default:
break;
}
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
}
protected void MenuHorizontal_MenuItemClick(object sender, MenuEventArgs e)
{
string str_year = this.DropDownList_Year.SelectedItem.Value.ToString ();
switch (e.Item.ValuePath.ToString())
{
case "Reports/ReportsUnderwater":
Response.Redirect("WebForm_Reports.aspx?inspection_type=U&ClientID=" + fstr_clientid + "&UserID = " + fstr_userid);
break;
case "Reports/ReportsTopside":
Response.Redirect("WebForm_Reports.aspx?inspection_type=T&ClientID=" + fstr_clientid + "&UserID = " + fstr_userid);
break;
case "Export/Topside":
string str_SQL1 = "";
string str_SQL2 = "";
string str_SQL3 = "";
string str_SQL4 = "";
string str_SQL5 = "";
string str_SQL6 = "";
string str_SQL7 = "";
string str_SQL8 = "";
string str_SQL9 = "";
string abc = Get_Query_Condition(" ", "Topside", str_year,ref str_SQL1, ref str_SQL2, ref str_SQL3, ref str_SQL4, ref str_SQL5, ref str_SQL6, ref str_SQL7, ref str_SQL8, ref str_SQL9);
string str_header="CAIRS : Topside [" + str_year + "]";
string str_picture= "/OCEANEERING_INSP.jpg";
//string str_connection;
string str_connection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
string str_file_prefix="CAIRS_Anomaly";
string str_mappath="//10.99.2.114/ExcelSheets";
//if (File.Exists("//10.99.2.114/CAIRS/Reports/APACHE/" + row["str_inspname"].ToString() + ".PDF") == true)
string str_xx = "";
string str_yy = "";
string str_str_cond_bad="Level 1 Structural Condition Is Rated Bad";
string str_coat_cond_bad="Level 1 Coating Condition Is Rated Bad";
string str_plat_str_anm="Platform Structural Anomalies";
string str_riser_dmg="Riser Damage";
string str_riser_coat_dmg="Riser Coating Damage";
string str_riser_pipe_dmg="Riser Pipeline Damage";
string str_riser_clmp_dmg="Riser Clamp Damage";
string str_leg_cp_rdg="Leg CP Readings";
string str_jtube_rdg="Riser/J-Tube CP Readings";
//CAIRS_Excel.CReport obj_CAIRS_Excel = new CAIRS_Excel.CReport();// = new obj_CAIRS_Excel();
//string str_ret_val = obj_CAIRS_Excel.Export_To_Excel(ref fstr_clientid, ref str_header, ref str_picture, ref str_connection, ref str_mappath, ref str_file_prefix, ref str_xx, ref str_yy, ref str_SQL1, ref str_SQL2, ref str_SQL3, ref str_SQL4, ref str_SQL5, ref str_SQL6, ref str_SQL7, ref str_SQL8, ref str_SQL9, ref str_str_cond_bad, ref str_coat_cond_bad, ref str_plat_str_anm, ref str_riser_dmg, ref str_riser_coat_dmg, ref str_riser_pipe_dmg, ref str_riser_clmp_dmg, ref str_leg_cp_rdg, ref str_jtube_rdg);
CAIRS_Excel.CReport obj_CAIRS_Excel = new CAIRS_Excel.CReport (); //.CReport();// = new obj_CAIRS_Excel();
//CAIRS_Excel.CReport obj_CAIRS_Excel;
fstr_clientid = "APACHE";
//obj_CAIRS_Excel = Server.CreateObject("CAIRS_Excel.CReport");
string str_ret_val = obj_CAIRS_Excel.Export_To_Excel(ref fstr_clientid, ref str_header, ref str_picture, ref str_connection, ref str_mappath, ref str_file_prefix, ref str_xx, ref str_yy, ref str_SQL1, ref str_SQL2, ref str_SQL3, ref str_SQL4, ref str_SQL5, ref str_SQL6, ref str_SQL7, ref str_SQL8, ref str_SQL9, ref str_str_cond_bad, ref str_coat_cond_bad, ref str_plat_str_anm, ref str_riser_dmg, ref str_riser_coat_dmg, ref str_riser_pipe_dmg, ref str_riser_clmp_dmg, ref str_leg_cp_rdg, ref str_jtube_rdg);
//Dim obj_CAIRS_Excel
//Set obj_CAIRS_Excel = Server.CreateObject("CAIRS_Excel.CReport")
//str_ret_val=obj_CAIRS_Excel.Export_To_Excel (cstr(str_client), cstr(str_header), cstr(str_picture), cstr(str_connection), cstr(str_mappath),cstr(str_file_prefix),"","",cstr(str_SQL1), cstr(str_SQL2), cstr(str_SQL3), cstr(str_SQL4), cstr(str_SQL5), cstr(str_SQL6), cstr(str_SQL7), cstr(str_SQL8), cstr(str_SQL9), "Level 1 Structural Condition Is Rated Bad", "Level 1 Coating Condition Is Rated Bad", "Platform Structural Anomalies", "Riser Damage", "Riser Coating Damage", "Riser Pipeline Damage", "Riser Clamp Damage", "Leg CP Readings","Riser/J-Tube CP Readings")
//Set obj_CAIRS_Excel=nothing
//set obj_CAIRS_Excel=nothing;
//Response.Write str_mappath & "<BR>" & str_ret_val
//Response.End
//Response.Redirect "CAIRS/ExcelSheets/" & str_ret_val
Response.Redirect ("ExcelSheets/" + str_ret_val);
break;
case "REPORTS/TOPSIDE REPORTS":
break;
case "REPORTS/TOPSIDEff":
break;
default:
break;
}
}
protected string Get_Query_Condition(string pstr_type,
string pstr_anomaly_type,
string pstr_year,
ref string str_SQL1,
ref string str_SQL2,
ref string str_SQL3,
ref string str_SQL4,
ref string str_SQL5,
ref string str_SQL6,
ref string str_SQL7,
ref string str_SQL8,
ref string str_SQL9)
{
switch (pstr_type)
{
case "Action Items":
//str_SQL1 = " SELECT " +
// " mst.lng_id, mst.lng_ge_user_id, mst.dte_daterequested, mst.str_recommendations, chld.str_detail_table, chld.lng_detail_id, " +
// " chld.str_anomaly_category, chld.str_closing_comments, dbo.tbl_pl_topside.str_inspname, dbo.tbl_pl_topside.str_comment_coating, " +
// " dbo.tbl_pl_topside.str_item, dbo.tbl_pl_topside.str_itemdsc, dbo.tbl_pl_topside.str_anomaly_status_coat, dbo.tbl_pl_topside.int_status_priority_coat, " +
// " dbo.tbl_pl_topside.str_coat_act, dbo.tbl_pl_topside.str_coat_cond, dbo.tbl_pl_topside.str_coat_rate, dbo.tbl_pl_topside.str_coat_dmg" +
// " FROM dbo.web_tbl_anomaly_request_detail chld INNER JOIN" +
// " dbo.tbl_pl_topside ON chld.lng_detail_id = dbo.tbl_pl_topside.lng_id AND dbo.tbl_pl_topside.lng_clientid = " + int_clientid + " RIGHT OUTER JOIN" +
// " dbo.web_tbl_anomaly_request mst ON chld.lng_anomaly_request_id = mst.lng_id" +
// " WHERE" +
// " (mst.lng_clientid = " + int_clientid + ") AND (chld.str_detail_table = 'tbl_pl_topside') AND (chld.str_anomaly_category = 'Level 1 Structural Condition Is Rated Bad')" +
// " ORDER BY" +
// " chld.str_anomaly_category";
str_SQL1 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_topside.str_inspname AS Inspection," +
" tbl_pl_topside.str_item AS Item,tbl_pl_topside.str_itemdsc AS [Item Desc.],tbl_pl_topside.str_comment_structure AS [Structural Comments]," +
" tbl_pl_topside.str_struc_cond AS [Structural Condition], tbl_pl_topside.str_struc_rate AS [Structural Rating],tbl_pl_topside.str_struc_dmg AS [Structural Damage]," +
" tbl_pl_topside.str_anomaly_status_struct AS [Anomaly Status],tbl_pl_topside.int_status_priority_struct AS Priority," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_topside ON chld.lng_detail_id = tbl_pl_topside.lng_id AND tbl_pl_topside.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_topside.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_topside') AND (chld.str_anomaly_category = 'Level 1 Structural Condition Is Rated Bad')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL2 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_topside.str_inspname AS Inspection," +
" tbl_pl_topside.str_item AS Item,tbl_pl_topside.str_itemdsc AS [Item Desc.],tbl_pl_topside.str_comment_coating AS [Coating Comments]," +
" tbl_pl_topside.str_coat_cond AS [Coating Condition], tbl_pl_topside.str_coat_rate AS [Coating Rating],tbl_pl_topside.str_coat_dmg AS [Coating Damage]," +
" tbl_pl_topside.str_anomaly_status_coat AS [Anomaly Status],tbl_pl_topside.int_status_priority_coat AS Priority," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_topside ON chld.lng_detail_id = tbl_pl_topside.lng_id AND tbl_pl_topside.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_topside.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_topside') AND (chld.str_anomaly_category = 'Level 1 Coating Condition Is Bad')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL3 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_anomaly.str_inspname as Inspection," +
" tbl_pl_anomaly.str_itemdsc as Item," +
" tbl_pl_anomaly.str_type as Type,tbl_pl_anomaly.str_anomaly_status as [Anomaly Status],tbl_pl_anomaly.str_comment as Comments, tbl_pl_anomaly.str_anomalyid as [Anomaly No.], tbl_pl_anomaly.int_dim_1_eng as Length," +
" tbl_pl_anomaly.int_dim_2_eng as Width,tbl_pl_anomaly.int_dim_3_eng as Depth," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_anomaly ON chld.lng_detail_id = tbl_pl_anomaly.lng_id AND tbl_pl_anomaly.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_anomaly.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_anomaly') AND (chld.str_anomaly_category = 'Platform Structural Anomalies')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL4 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment as Segment, tbl_pl_riser.str_anomaly_status_riser as [Anomaly Status],tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as [Riser Diameter]," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL5 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.lng_id,tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment as Segment, tbl_pl_riser.str_anomaly_status_coat as [Anomaly Status], tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as Diameter," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Coating Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL6 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn as [Group]," +
" tbl_pl_riser.str_inspname as Inspection, tbl_pl_riser.str_item as Item," +
" tbl_pl_riser.str_segment, tbl_pl_riser.str_anomaly_status_pipeline as [Anomaly Status],tbl_pl_riser.str_comment as Comments," +
" tbl_pl_riser.int_riser_diam_eng as Diameter," +
" usr.str_first AS [First Name], usr.str_last AS [Last Name]" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_riser ON chld.lng_detail_id = tbl_pl_riser.lng_id AND tbl_pl_riser.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_riser.str_inspname, 1, 8) RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_riser') AND (chld.str_anomaly_category = 'Riser Pipeline Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
str_SQL7 = " SELECT mst.lng_id, mst.lng_id AS [Request ID], mst.dte_daterequested AS [Submitted Date], mst.str_recommendations AS Recommendations," +
" chld.str_closing_comments AS [Closing Comments], plat.str_divn AS [Group]," +
" tbl_pl_clamp.str_inspname as Inspection, tbl_pl_riser.str_item AS Item,tbl_pl_clamp.str_item as [Clamp No.]," +
" tbl_pl_clamp.str_anomaly_status as [Anomaly Status], tbl_pl_clamp.str_clamp_type as [Clamp Type], tbl_pl_clamp.str_comment as Comments," +
" tbl_pl_clamp.int_depth1_eng as Depth, " +
" tbl_pl_clamp.int_r_bolt_exp as [Riser Bolt Exp.],tbl_pl_clamp.int_r_bolt_mis as [Riser Bolt Missing]," +
" tbl_pl_clamp.int_r_gap_eng as [Riser Gap],tbl_pl_clamp.int_s_bolt_exp as [Structure Bolt Exp.]," +
" tbl_pl_clamp.int_s_bolt_mis as [Structure Bolt Missing],tbl_pl_clamp.int_s_gap_eng as [Structure Gap]," +
" usr.str_last AS [Last Name],tbl_pl_riser.str_item,tbl_pl_riser.str_itemdsc" +
" FROM" +
" tbl_pl_platform_details plat INNER JOIN" +
" web_tbl_anomaly_request_detail chld INNER JOIN" +
" tbl_pl_clamp ON chld.lng_detail_id = tbl_pl_clamp.lng_id AND tbl_pl_clamp.lng_clientid = " + fstr_clientid + " ON" +
" plat.str_pstrname = SUBSTRING( tbl_pl_clamp.str_inspname, 1, 8) INNER JOIN" +
" tbl_pl_riser ON tbl_pl_clamp.lng_clientid = tbl_pl_riser.lng_clientid AND" +
" tbl_pl_clamp.lng_riserid = tbl_pl_riser.lng_id RIGHT OUTER JOIN" +
" web_tbl_ge_users usr INNER JOIN" +
" web_tbl_anomaly_request mst ON usr.lng_id = mst.lng_ge_user_id AND usr.lng_clientid = " + fstr_clientid + " ON" +
" chld.lng_anomaly_request_id = mst.lng_id" +
" WHERE" +
" (mst.lng_clientid = " + fstr_clientid + ") AND (chld.str_detail_table = 'tbl_pl_clamp') AND (chld.str_anomaly_category = 'Riser Clamp Damage')" +
" ORDER BY" +
" mst.lng_id DESC";
break;
default:
//* -Platform Structure Bad */
str_SQL1 = "SELECT web_view_platform_tbl_pl_topside.lng_id,web_view_platform_tbl_pl_topside.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_topside.str_itemdsc as [Item Desc]," +
" web_view_platform_tbl_pl_topside.str_item as Item, web_view_platform_tbl_pl_topside.str_anomaly_status_struct as [Anomaly Status], web_view_platform_tbl_pl_topside.str_comment_structure as Comments," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_topside ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_topside.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_topside.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_topside'" +
" WHERE ( web_view_platform_tbl_pl_topside.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_topside.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_topside.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_topside.str_struc_dmg = 'YES') AND" +
"( web_view_platform_tbl_pl_topside.str_struc_cond = 'BAD') AND ( web_view_platform_tbl_pl_topside.int_insp_year <> 9200)" +
" ORDER BY web_view_platform_tbl_pl_topside.str_insp_pstrname, web_view_platform_tbl_pl_topside.lng_id" ;
//* -Platform Coating Bad */
str_SQL2 = "SELECT " +
" web_view_platform_tbl_pl_topside.lng_id,web_view_platform_tbl_pl_topside.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_topside.str_itemdsc as [Item Desc], web_view_platform_tbl_pl_topside.str_item as Item, " +
" web_view_platform_tbl_pl_topside.str_anomaly_status_coat as [Anomaly Status]," +
" web_view_platform_tbl_pl_topside.str_comment_coating as Comments," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_topside ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_topside.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_topside.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_topside'" +
" WHERE ( web_view_platform_tbl_pl_topside.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_topside.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_topside.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_topside.int_insp_year <> 9200) AND" +
"(UPPER( web_view_platform_tbl_pl_topside.str_coat_dmg) = 'YES') AND ( web_view_platform_tbl_pl_topside.str_coat_cond = 'BAD' OR ltrim(rtrim( web_view_platform_tbl_pl_topside.str_coat_cond)) = 'C')" +
" ORDER BY web_view_platform_tbl_pl_topside.str_insp_pstrname, web_view_platform_tbl_pl_topside.lng_id";
//* '-Platform Structural anomaly */
str_SQL3 = "SELECT web_view_platform_tbl_pl_anomaly.lng_id, web_view_platform_tbl_pl_anomaly.str_insp_pstrname as Facility," +
" web_view_platform_tbl_pl_anomaly.str_itemdsc as Item," +
" web_view_platform_tbl_pl_anomaly.str_type as Type,web_view_platform_tbl_pl_anomaly.str_anomaly_status as [Anomaly Status],web_view_platform_tbl_pl_anomaly.str_comment as Comments, web_view_platform_tbl_pl_anomaly.str_anomalyid as [Anomaly No.], web_view_platform_tbl_pl_anomaly.int_dim_1_eng as Length," +
" web_view_platform_tbl_pl_anomaly.int_dim_2_eng as Width, web_view_platform_tbl_pl_anomaly.int_dim_3_eng as Depth," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], tbl_ge_media_log.str_photodrawvideo AS [Image Type] " +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_anomaly ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_anomaly.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_anomaly.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_pl_anomaly'" +
" WHERE ( web_view_platform_tbl_pl_anomaly.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_anomaly.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_anomaly.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_anomaly.int_insp_year <> 9200) AND" +
" upper ( web_view_platform_tbl_pl_anomaly.str_anomaly_status) <> 'CLEARED'" +
" ORDER BY web_view_platform_tbl_pl_anomaly.str_insp_pstrname, web_view_platform_tbl_pl_anomaly.lng_id";
//* '-Riser Damage */
str_SQL4 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment as Segment, web_view_platform_tbl_pl_riser.str_anomaly_status_riser as [Anomaly Status],web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as [Riser Diameter]," +
" tbl_ge_media_log.str_caption AS [Image Caption], tbl_ge_media_log.str_image AS [Image Name]," +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tb_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_riser_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Coating Anomaly */
str_SQL5 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment as Segment, web_view_platform_tbl_pl_riser.str_anomaly_status_coat as [Anomaly Status], web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as Diameter," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_coat_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Pipeline Anomaly */
str_SQL6 = "SELECT web_view_platform_tbl_pl_riser.lng_id,web_view_platform_tbl_pl_riser.str_insp_pstrname as Facility, web_view_platform_tbl_pl_riser.str_item as Item," +
" web_view_platform_tbl_pl_riser.str_segment, web_view_platform_tbl_pl_riser.str_anomaly_status_pipeline as [Anomaly Status],web_view_platform_tbl_pl_riser.str_comment as Comments," +
" web_view_platform_tbl_pl_riser.int_riser_diam_eng as Diameter," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id RIGHT OUTER JOIN" +
" web_view_platform_tbl_pl_riser ON tbl_ge_media_link.lng_clientid = web_view_platform_tbl_pl_riser.lng_clientid AND" +
" tbl_ge_media_link.lng_insp_id = web_view_platform_tbl_pl_riser.lng_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_riser'" +
" WHERE ( web_view_platform_tbl_pl_riser.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_riser.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_riser.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_riser.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_riser.bln_pipe_dmg = 1)" +
" ORDER BY web_view_platform_tbl_pl_riser.str_insp_pstrname, web_view_platform_tbl_pl_riser.lng_id";
//* -Riser Clamp Anomaly */
str_SQL7 = "SELECT web_view_platform_tbl_pl_clamp.lng_id,web_view_platform_tbl_pl_clamp.str_insp_pstrname as Facility, tbl_pl_riser.str_item AS Item,web_view_platform_tbl_pl_clamp.str_item as [Clamp No.]," +
" web_view_platform_tbl_pl_clamp.str_anomaly_status as [Anomaly Status], web_view_platform_tbl_pl_clamp.str_clamp_type as [Clamp Type], web_view_platform_tbl_pl_clamp.str_comment as Comments," +
" web_view_platform_tbl_pl_clamp.int_depth1_eng as Depth, " +
" web_view_platform_tbl_pl_clamp.int_r_bolt_exp as [Riser Bolt Exp.], web_view_platform_tbl_pl_clamp.int_r_bolt_mis as [Riser Bolt Missing]," +
" web_view_platform_tbl_pl_clamp.int_r_gap_eng as [Riser Gap], web_view_platform_tbl_pl_clamp.int_s_bolt_exp as [Structure Bolt Exp.]," +
" web_view_platform_tbl_pl_clamp.int_s_bolt_mis as [Structure Bolt Missing], web_view_platform_tbl_pl_clamp.int_s_gap_eng as [Structure Gap]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type]" +
" FROM tbl_pl_riser INNER JOIN" +
" web_view_platform_tbl_pl_clamp ON tbl_pl_riser.lng_clientid = web_view_platform_tbl_pl_clamp.lng_clientid AND" +
" tbl_pl_riser.lng_id = web_view_platform_tbl_pl_clamp.lng_riserid LEFT OUTER JOIN" +
" tbl_ge_media_link INNER JOIN" +
" tbl_ge_media_log ON tbl_ge_media_link.lng_clientid = tbl_ge_media_log.lng_clientid AND" +
" tbl_ge_media_link.lng_media_id = tbl_ge_media_log.lng_id ON" +
" web_view_platform_tbl_pl_clamp.lng_clientid = tbl_ge_media_link.lng_clientid AND" +
" web_view_platform_tbl_pl_clamp.lng_id = tbl_ge_media_link.lng_insp_id AND tbl_ge_media_link.str_insp_tabl = 'tbl_pl_clamp'" +
" WHERE ( web_view_platform_tbl_pl_clamp.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_clamp.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_clamp.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_clamp.int_insp_year <> 9200) AND" +
"( web_view_platform_tbl_pl_clamp.bln_r_damage = 1) OR" +
"( web_view_platform_tbl_pl_clamp.lng_clientid = " + fstr_clientid + ") AND ( web_view_platform_tbl_pl_clamp.int_insp_year = " + pstr_year + ") AND" +
"( web_view_platform_tbl_pl_clamp.str_insp_type = '" + pstr_anomaly_type + "') AND ( web_view_platform_tbl_pl_clamp.int_insp_year <> 9200) AND ( web_view_platform_tbl_pl_clamp.bln_s_damage = 1)" +
" ORDER BY web_view_platform_tbl_pl_clamp.str_insp_pstrname, web_view_platform_tbl_pl_clamp.lng_id";
//* LEG CP Riser-JTube Anomalies */
str_SQL8 = "SELECT COUNT(T1.lng_id),T1.str_insp_pstrname as Facility," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS [Number of Readings]" +
" FROM web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND " +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND " +
" web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Number of Readings]," +
" MAX(T1.int_cp_read) AS [Minimum Reading], MIN(T1.int_cp_read) AS [Maximum Reading]," +
" AVG(T1.int_cp_read) AS [Average Reading]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong" +
" From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read < - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Good Readings]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read > - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Bad Readings]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type], dbo.tbl_ge_inspection.lng_id" +
" FROM tbl_ge_media_log INNER JOIN tbl_ge_media_link ON tbl_ge_media_log.lng_id = tbl_ge_media_link.lng_media_id AND" +
" tbl_ge_media_log.lng_clientid = tbl_ge_media_link.lng_clientid AND tbl_ge_media_log.str_photodrawvideo = 'DRAWING' AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection' RIGHT OUTER JOIN" +
" web_view_platform_tbl_ge_cp_read T1 INNER JOIN tbl_ge_inspection ON T1.str_insp_pstrname = tbl_ge_inspection.str_pstrname AND T1.lng_clientid = tbl_ge_inspection.lng_clientid AND" +
" tbl_ge_inspection.str_inspect_type = '" + pstr_anomaly_type + "' AND tbl_ge_inspection.int_inspect_year = " + pstr_year + " ON tbl_ge_media_link.lng_clientid = tbl_ge_inspection.lng_clientid AND tbl_ge_media_link.lng_insp_id = tbl_ge_inspection.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" WHERE (T1.lng_clientid = " + fstr_clientid + ") AND (T1.int_insp_year = " + pstr_year + ") AND (T1.str_insp_type = '" + pstr_anomaly_type + "') AND (T1.str_itemdsc = 'LEG') AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" GROUP BY T1.str_insp_pstrname, tbl_ge_inspection.str_pstrname, tbl_ge_media_link.str_insp_tabl, dbo.tbl_ge_media_log.str_caption, tbl_ge_media_log.str_image," +
" dbo.tbl_ge_media_log.str_photodrawvideo, tbl_ge_inspection.lng_id" +
" ORDER BY T1.str_insp_pstrname";
//* CP Riser-JTube Anomalies */
str_SQL9 = "SELECT COUNT(T1.lng_id), T1.str_insp_pstrname as Facility," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS [Number of Readings]" +
" FROM web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND " +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND " +
" web_view_platform_tbl_ge_cp_read.str_itemdsc = 'LEG') AS [Number of Readings]," +
" MAX(T1.int_cp_read) AS [Minimum Reading], MIN(T1.int_cp_read) AS [Maximum Reading]," +
" AVG(T1.int_cp_read) AS [Average Reading]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong" +
" From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read < - 800 AND web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND (web_view_platform_tbl_ge_cp_read.str_itemdsc = 'RISER' OR web_view_platform_tbl_ge_cp_read.str_itemdsc = 'J-TUBE')) AS [Good Readings]," +
" (SELECT COUNT(web_view_platform_tbl_ge_cp_read.lng_id) AS NumWrong From web_view_platform_tbl_ge_cp_read" +
" WHERE web_view_platform_tbl_ge_cp_read.lng_clientid = " + fstr_clientid + " AND web_view_platform_tbl_ge_cp_read.int_insp_year = " + pstr_year + " AND web_view_platform_tbl_ge_cp_read.str_insp_type = '" + pstr_anomaly_type + "' AND int_cp_read > - 800 AND" +
" web_view_platform_tbl_ge_cp_read.str_insp_pstrname = T1.str_insp_pstrname AND (web_view_platform_tbl_ge_cp_read.str_itemdsc = 'RISER' OR web_view_platform_tbl_ge_cp_read.str_itemdsc = 'J-TUBE')) AS [Bad Readings]," +
" tbl_ge_media_log.str_caption AS [Image Caption]," +
" tbl_ge_media_log.str_image AS [Image Name], " +
" tbl_ge_media_log.str_photodrawvideo AS [Image Type], dbo.tbl_ge_inspection.lng_id" +
" FROM tbl_ge_media_log INNER JOIN" +
" tbl_ge_media_link ON tbl_ge_media_log.lng_id = tbl_ge_media_link.lng_media_id AND tbl_ge_media_log.lng_clientid = tbl_ge_media_link.lng_clientid AND tbl_ge_media_log.str_photodrawvideo = 'DRAWING' AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection' RIGHT OUTER JOIN web_view_platform_tbl_ge_cp_read T1 INNER JOIN" +
" tbl_ge_inspection ON T1.str_insp_pstrname = tbl_ge_inspection.str_pstrname AND T1.lng_clientid = tbl_ge_inspection.lng_clientid AND" +
" tbl_ge_inspection.str_inspect_type = '" + pstr_anomaly_type + "' AND tbl_ge_inspection.int_inspect_year = " + pstr_year + " ON" +
" tbl_ge_media_link.lng_clientid = tbl_ge_inspection.lng_clientid AND tbl_ge_media_link.lng_insp_id = tbl_ge_inspection.lng_id AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" WHERE (T1.lng_clientid = " + fstr_clientid + ") AND (T1.int_insp_year = " + pstr_year + ") AND (T1.str_insp_type = '" + pstr_anomaly_type + "') AND (T1.str_itemdsc = 'RISER' OR T1.str_itemdsc = 'J-TUBE') AND" +
" tbl_ge_media_link.str_insp_tabl = 'tbl_ge_inspection'" +
" GROUP BY T1.str_insp_pstrname, tbl_ge_inspection.str_pstrname, tbl_ge_media_link.str_insp_tabl, dbo.tbl_ge_media_log.str_caption, tbl_ge_media_log.str_image," +
" dbo.tbl_ge_media_log.str_photodrawvideo, tbl_ge_inspection.lng_id" +
" ORDER BY T1.str_insp_pstrname" ;
break;
}
return " ";
}
#region EventHandlers
protected void btnFilter_Click(object sender, System.EventArgs e)
{
//All error checking is done on the form...any additional error checking could be done here before fitering.
ShowFilteredData();
}
protected void lnkSubmitCorrections_Click(object sender, System.EventArgs e)
{
SubmitSelectedCorrections();
}
#endregion
#region MethodsUsedByGrid
public string GetStrippedComments(string Comments)
{
string OptionsString = String.Empty;
TextConverter.RTFConverterClass TxtCon = null;
if (TxtCon == null)
{
TxtCon = new TextConverter.RTFConverterClass();
}
return TxtCon.rtf2html(ref Comments, ref OptionsString);
}
public string GetImagesPath(string pLngid, string pStr_Table, string Photo_Or_Drawing)
{
string ImagePath = System.Configuration.ConfigurationSettings.AppSettings["ImagePath"];
// Response.Write (String.Format(ImagePath, pLngid, this.fstr_clientid, pStr_Table, Photo_Or_Drawing));
//Response.End();
return String.Format(ImagePath, pLngid, this.fstr_clientid, pStr_Table, Photo_Or_Drawing);
//<add key="ImagePath" value="http://10.99.2.117/ImageViewer.aspx?id={0}&ClientID={1}&tbl={2}"/>
//return "aaa";
}
#endregion
#region Methods
private void SubmitSelectedCorrections()
{
System.Web.UI.WebControls.CheckBox Box = null;
string PrimaryKey = String.Empty;
foreach (System.Web.UI.WebControls.DataGridItem GridRow in this.grdClientData.Items)
{
if (GridRow.ItemType != ListItemType.Header && GridRow.ItemType != ListItemType.Footer)
{
Box = (System.Web.UI.WebControls.CheckBox)GridRow.FindControl("chkAnomaly");
if (Box.Checked)
{
PrimaryKey = this.grdClientData.DataKeys[GridRow.ItemIndex].ToString();
}
}
}
}
private void ShowFilteredData()
{
string Query = "SELECT * FROM dbo.view_platform_tbl_ge_inspection "; //Simple test query.
//String.Format is a much faster way to concatnate strings.
// Query += String.Format("WHERE lng_clientid = {0} AND str_inspect_no = '{1}'", this.cboClient.SelectedValue, this.cboYear.SelectedValue);
this.grdClientData.DataSource = GetData(Query);
this.grdClientData.DataBind();
//this.pnlClientData.Visible = true;
}
private void SetupPage()
{
//Fill the client drop down.
//this.cboClient.DataTextField = "str_client";
//this.cboClient.DataValueField = "lng_id";
// this.cboClient.DataSource = GetData("SELECT TOP 10 * FROM dbo.web_tbl_ge_clients ORDER BY str_client");
//this.cboClient.DataBind();
//this.cboClient.Items.Insert(0, new ListItem("", "")); //Adding a blank entry at the top
//Fill the year drop down. Im going to start at 2000.
for (int Year = 2000; Year <= System.DateTime.Now.Year; Year++)
{
// this.cboYear.Items.Add(new ListItem(Year.ToString(), Year.ToString()));
}
// this.cboYear.Items.Insert(0, new ListItem("", "")); //Adding a blank entry at the top
}
#endregion
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
public void LoadData(string pStr_Module)
{
string str_clientid = (Request.QueryString["ClientID"]);
OleDbCommand testCMD;
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionStringOLEDB"];
OleDbConnection PubsConn = new OleDbConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
testCMD = new OleDbCommand("Netsp_retrieve_anomaly_ec_all", PubsConn);
break;
default:
testCMD = new OleDbCommand("Netsp_retrieve_anomaly_all", PubsConn);
break;
}
testCMD.CommandType = CommandType.StoredProcedure;
testCMD.CommandTimeout = 10000;
OleDbParameter ClientID = testCMD.Parameters.Add("@ClientID", OleDbType.Integer);
ClientID.Direction = ParameterDirection.Input;
ClientID.Value = fstr_clientid;
OleDbParameter Year = testCMD.Parameters.Add("@Year", OleDbType.Integer);
Year.Direction = ParameterDirection.Input;
if (this.DropDownList_Year.Items.Count > 0)
{
Year.Value = this.DropDownList_Year.SelectedItem.Value;
}
else
{
Year.Value = 1800;
}
OleDbParameter AnomalyType = testCMD.Parameters.Add("@AnomalyType", OleDbType.VarChar, 2);
AnomalyType.Direction = ParameterDirection.Input;
AnomalyType.Value = this.DropDownList_Inspection.SelectedItem.Value.Substring(0, 1);
string str_selected_anomalies = "";
int indx = 0;
OleDbParameter AnomalyCategories = testCMD.Parameters.Add("@AnomalyCategories", OleDbType.VarChar, 20);
AnomalyCategories.Direction = ParameterDirection.Input;
string str_cats = "";
if (this.DropDownList_Anomaly.SelectedItem.Value.TrimStart().TrimEnd().ToUpper() == "ALL")
{
AnomalyCategories.Value = "1,2,3,4,5,6,7,8,9,";
}
else
{
str_selected_anomalies = this.DropDownList_Anomaly.SelectedItem.Value;
indx = this.DropDownList_Anomaly.SelectedIndex;
AnomalyCategories.Value = indx.ToString() + ",";
}
str_cats = AnomalyCategories.Value.ToString();
OleDbParameter AnomalyStatus = testCMD.Parameters.Add("@AnomalyStatus", OleDbType.VarChar, 15);
AnomalyStatus.Direction = ParameterDirection.Input;
AnomalyStatus.Value = this.DropDownList_Status.SelectedItem.Value.ToString().TrimStart().TrimEnd();
PubsConn.Open();
//exec Netsp_retrieve_anomaly_all 18, 2004, 'T', '1,2,3,4,5,6,7,8,9', 'All'
OleDbDataReader myReader = testCMD.ExecuteReader();
ShowFilteredData(myReader);
int tt = 0;
int int_query = 0;
string str_temp;
int int_total_rows = 0;
string str_query_category = "";
if (str_cats != "1,2,3,4,5,6,7,8,9,")
{
//int_query=indx-2;
}
do
{
str_query_category = Get_Query_Category(myReader);
tt++;
int_query++;
switch (str_query_category)
{
//case 1:
case "Structural Bad":
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
break;
//case 2:
case "Coating Bad":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_02.Width = 640;
this.DataGrid_02.Visible = true;
this.DataGrid_02.DataSource = myReader;
this.DataGrid_02.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 3:
case "Anomaly":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_03.Width = 640;
this.DataGrid_03.Visible = true;
this.DataGrid_03.DataSource = myReader;
this.DataGrid_03.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 4:
case "Riser Damage":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_04.Width = 640;
this.DataGrid_04.Visible = true;
this.DataGrid_04.DataSource = myReader;
this.DataGrid_04.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 5:
case "Riser Coating Damage":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_05.Width = 640;
this.DataGrid_05.Visible = true;
this.DataGrid_05.DataSource = myReader;
this.DataGrid_05.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 6:
case "Riser Pipeline Damage":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_06.Width = 640;
this.DataGrid_06.Visible = true;
this.DataGrid_06.DataSource = myReader;
this.DataGrid_06.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 7:
case "Riser Clamp Damage":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_07.Width = 640;
this.DataGrid_07.Visible = true;
this.DataGrid_07.DataSource = myReader;
this.DataGrid_07.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 8:
case "CP Legs":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_08.Width = 640;
this.DataGrid_08.Visible = true;
this.DataGrid_08.DataSource = myReader;
this.DataGrid_08.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
//case 9:
case "CP Riser/J-Tube":
if (Request.Form["DropDownList_Anomaly"] == "All")
{
this.DataGrid_09.Width = 640;
this.DataGrid_09.Visible = true;
this.DataGrid_09.DataSource = myReader;
this.DataGrid_09.DataBind();
}
else
{
this.DataGrid_01.Width = 640;
this.DataGrid_01.Visible = true;
this.DataGrid_01.DataSource = myReader;
this.DataGrid_01.DataBind();
}
break;
default:
break;
}
//Do
}
while (myReader.NextResult());
////////READING DATA...End/////////////////////////
myReader.Close();
}
#endregion
public void Populate_Groups(string pStr_Module)
{
SqlDataAdapter CAIRS_DataAdapter;
DataSet CAIRS_DataSet;
this.TextBox_Hidden_Group.Text = "All";
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
this.DropDownList_Group.Items.Clear();
this.DropDownList_Group.Items.Add("All");
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_division FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY str_division", CAIRS_DataConnection);
break;
default:
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_divn FROM tbl_pl_platform_details WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY str_divn", CAIRS_DataConnection);
break;
}
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Group.Items.Add(row.ItemArray.GetValue(0).ToString());
}
}
public void Populate_Year(string pStr_Module)
{
SqlDataAdapter CAIRS_DataAdapter;
DataSet CAIRS_DataSet;
//this.TextBox_Hidden_Group.Text = "All";
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT YEAR(dte_last_inspection)AS insp_year FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY insp_year DESC", CAIRS_DataConnection);
break;
default:
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT int_inspect_year FROM tbl_ge_inspection WHERE lng_clientid=" + this.fstr_clientid + " ORDER BY int_inspect_year desc", CAIRS_DataConnection);
break;
}
//===============================================================================
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Year.Items.Clear();
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Year.Items.Add(row.ItemArray.GetValue(0).ToString());
}
}
public void Populate_Facilities(string pStr_Module, string pStr_selected_group)
{
SqlDataAdapter CAIRS_DataAdapter;
DataSet CAIRS_DataSet;
string str_condition = "";
string CAIRS_DataConnection = System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"];
SqlConnection CAIRS_Data_Connection = new SqlConnection(CAIRS_DataConnection);
switch (pStr_Module)
{
case "EC":
if ((pStr_selected_group.ToString() == "All") | (pStr_selected_group.ToString() == ""))
{
str_condition = "";
}
else
{
str_condition = " AND str_division='" + pStr_selected_group + "'";
}
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_facility FROM tbl_ec_master_findings WHERE lng_clientid=" + this.fstr_clientid + str_condition+ " ORDER BY str_facility", CAIRS_DataConnection);
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Facility.Items.Clear();
this.DropDownList_Facility.Items.Add("All");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Facility.Items.Add(row.ItemArray.GetValue(0).ToString());
}
break;
default:
if ((pStr_selected_group.ToString() == "All") | (pStr_selected_group.ToString() == ""))
{
str_condition = "";
}
else
{
str_condition = " AND str_divn='" + pStr_selected_group + "'";
}
CAIRS_DataAdapter = new SqlDataAdapter("SELECT DISTINCT str_pstrname FROM tbl_pl_platform_details WHERE lng_clientid=" + this.fstr_clientid + str_condition + " ORDER BY str_pstrname", CAIRS_DataConnection);
CAIRS_DataSet = new DataSet();
CAIRS_DataAdapter.Fill(CAIRS_DataSet, "Table");
this.DropDownList_Facility.Items.Clear();
this.DropDownList_Facility.Items.Add("All");
foreach (DataRow row in CAIRS_DataSet.Tables[0].Rows)
{
this.DropDownList_Facility.Items.Add(row.ItemArray.GetValue(0).ToString());
}
break;
}
}
}
jcasp
Star
11540 Points
2286 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 05:31 PM|LINK
Thanks for posting your code-behind source. Now, can you also post your .aspx as well.
Before you do that, I just had a thought. Can you make sure you didn't use the letter "O" instead of the number "0" when you renamed your DataGrid? Sounds trivial, but many problems usually are.
jcasp
Star
11540 Points
2286 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 05:32 PM|LINK
nair7
Member
155 Points
32 Posts
Re: DataGrid; Does not contain definition; error message
Jan 27, 2006 05:41 PM|LINK
Thank you.
I checked for O/0 and I/1.
Here is the source code.
Thanks.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WF_Home.aspx.cs" Inherits="WF_Home" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
<!--
function openfiltermenu()
{
document.hidemenuimg.src = 'Images/hide_menu.gif'
FilterMenu.style.left = '0'
hidemenulnk.href = "javascript:closefiltermenu()"
}
function closefiltermenu()
{
document.hidemenuimg.src = 'Images/show_menu.gif'
FilterMenu.style.left = '-195'
hidemenulnk.href = "javascript:openfiltermenu()"
}
//-->
</script>
<link href="css/inspection_main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {
font-size: 14px;
font-weight: bold;
color: #000066;
}
-->
</style>
</head>
<body >
<table width='100%' border="0" cellpadding="0" cellspacing="0" style="height: 1091px">
<tr style="background-image:url(file:Images/header_right.jpg)">
<td><table width='100%' border="0" cellpadding="0" cellspacing="0" >
<tr>
<td style="width:641px"><img src="Images/header_left.jpg" alt="" width="645" height="66" /></td>
<td bgcolor="#2768A0" ><div><img alt="" src="Images/header_middle.jpg" width="377" height="66" /></div></td>
</tr>
<tr>
<td colspan="2" bgcolor="#000000" style="width:641px">
<table width="100%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td >
<span style="border:solid #999999 1px"><span style="padding: 0px 4px 2px 4px" ><a href="#" class="top_menu" >Home</a></span></span>
<span style="border:solid #999999 1px"><span style="padding: 0px 4px 2px 4px" ><a href="#" class="top_menu" onclick="MM_showHideLayers('FilterMenu','','show')">Menu</a></span></span> </td>
<td><img src="Images/spacer.gif" width="1" height="15"></td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
<tr >
<td style="height: 928px"><br />
<table align="center" cellpadding="0" cellspacing="0" style="width: 85%; height: 917px;">
<tr>
<td align="center" style="height: 917px"><form id="form1" runat="server">
<table style=" height:100% " >
<tr>
<td valign="top" style="height: 1840px">
<!-- Begin Data filter dropdown lists-->
<div id="FilterMenu">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="100%" align="center" cellpadding="3" cellspacing="3" >
<tr><td align="left">
<asp:Label ID="Label5" runat="server" BackColor="Black" Font-Names="Arial"
ForeColor="White" Height="21px" Text="Inspection:" Width="102px" BorderColor="Transparent" Font-Size="Small"></asp:Label><br />
<asp:DropDownList ID="DropDownList_Inspection" runat="server" OnSelectedIndexChanged="DropDownList_Inspection_SelectedIndexChanged"
ToolTip="Inspection Type" Width="92px" Height="20px" AutoPostBack="True">
<asp:ListItem Selected="True">Topside</asp:ListItem>
<asp:ListItem>Underwater</asp:ListItem>
<asp:ListItem>Process</asp:ListItem>
</asp:DropDownList><br />
<asp:Label ID="Label1" runat="server" BackColor="Black" Font-Names="Arial" ForeColor="White"
Height="21px" Text="Group:"
Width="117px" Font-Size="Small"></asp:Label><br />
<asp:DropDownList ID="DropDownList_Group" runat="server" DataTextField="str_divn"
DataValueField="str_divn" OnSelectedIndexChanged="DropDownList_Group_SelectedIndexChanged"
ToolTip="Division" Width="117px" Height="25px" AutoPostBack="True">
<asp:ListItem Selected="True">All</asp:ListItem>
</asp:DropDownList><br />
<asp:Label ID="Label2" runat="server" BackColor="Black" Font-Names="Arial" ForeColor="White"
Height="21px" Font-Size="Small" Text="Facility:"
Width="102px"></asp:Label><br />
<asp:DropDownList ID="DropDownList_Facility" runat="server" DataTextField="str_pstrname"
DataValueField="str_pstrname"
ToolTip="Structure Name" Width="102px" Height="24px"> </asp:DropDownList><br />
<asp:Label ID="Label3" runat="server" BackColor="Black" Font-Names="Arial" ForeColor="White" Height="21px" Font-Size="Small" Text="Anomaly:" Width="154px"> </asp:Label><br />
<asp:DropDownList ID="DropDownList_Anomaly" runat="server" ToolTip="Anomaly Type" Width="154px" Height="25px"> </asp:DropDownList><br />
<asp:Label ID="Label4" runat="server" BackColor="Black" Font-Names="Arial" ForeColor="White" Height="21px" Font-Size="Small" Text="Year:" Width="56px"> </asp:Label><br />
<asp:DropDownList ID="DropDownList_Year" runat="server" ToolTip="Inspection Year" Width="56px" AutoPostBack="True"> </asp:DropDownList><br />
<asp:Label ID="Label6" runat="server" BackColor="Black" Font-Names="Arial" ForeColor="White" Font-Size="Small"
Height="21px" Text="Status:"
Width="81px"></asp:Label><br />
<asp:DropDownList ID="DropDownList_Status" runat="server" ToolTip="Inspection Year" Width="90px">
<asp:ListItem>All</asp:ListItem>
<asp:ListItem>Outstanding</asp:ListItem>
<asp:ListItem>Pending</asp:ListItem>
<asp:ListItem>Revisit</asp:ListItem>
</asp:DropDownList><br /><br />
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="Images/go.jpg" />
<!-- End Data filter dropdown lists-->
<hr />
<asp:Label ID="Label7" runat="server" BorderStyle="None" BackColor="Black" Font-Names="Arial" ForeColor="White" Font-Size="Small" Text="Search"
Width="67px"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
<asp:Image ID="Image1" runat="server" ImageUrl="Images/Go.jpg" /> </td></tr></table> </td>
<td valign="middle" background="Images/menutab_bg.gif" bgcolor="#999999" style="border:#000000 solid 2px"><a href="javascript:closefiltermenu()" name="hidemenulnk" id="hidemenulnk"><img src="Images/hide_menu.gif" name="hidemenuimg" width="25" height="200" border="0" id="hidemenuimg" /></a></td>
</tr>
</table>
</div>
<!--Begin Portal "home" tables. These should display when client initially logs in and not display fiter qery is executed-->
<table width="770px" cellpadding="0" cellspacing="6" bgcolor="#FFFFFF" style="border: #000000 solid 1px">
<tr>
<td width="50%">
<table cellpadding="3" cellspacing="3">
<tr>
<td>
<div align="left"><span><img src="Images/clientlogos/forest.gif" alt="" style="float:left" /></span><span class="style3"><span class="style5">Overview</span>
<br />
Welcome, Joey to FOREST OIL CORPORATION's Mechanical Integrity Web Console, there are a total of 5851 items in your Web Database.
</span><span></span></div></td>
</tr>
</table> </td>
<td background="Images/dot_bg_drk_vert.gif" style="width:1px"><img src="Images/spacer.gif" alt="" width="1" height="1" /> </td>
<td align="left" width="50%" valign="top" class="style3">
<table cellpadding="3" cellspacing="3">
<tr><td><span class="style5"> We have reported:</span>
<li>2 Potential Unsafe Items </li>
<li>134 Action Items</li>
<li>183 Caution Items </li>
<li>24 General Findings </li>
</td></tr>
</table> </td>
</tr>
<tr>
<td colspan="3" background="Images/dot_bg_drk.gif"><img src="Images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td colspan="3">..</td>
</tr>
</table>
<!-- Begin Data Tables-->
<asp:DataGrid ID="DataGrid_02" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="53%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 142px; position: absolute; top: 533px" Height="1px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="OliveDrab" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Group"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Item Name"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Description">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn HeaderText="Last Inspection"></asp:BoundColumn>
<asp:BoundColumn HeaderText="Next Inspection"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Report">
<itemtemplate>
<asp:HyperLink ID="Reports" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_03" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 132px; position: absolute; top: 688px" Height="120px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="CornflowerBlue" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_04" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 131px; position: absolute; top: 836px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="DarkViolet" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_01" runat="server" Style="left: 246px; position: absolute;
top: 352px" Width="271px" AllowSorting="True" AutoGenerateColumns="False" DataKeyField="lng_id">
<AlternatingItemStyle BackColor="Tan" />
</asp:DataGrid>
<asp:DataGrid ID="grdClientData" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="30%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 155px; position: absolute; top: 423px" Height="1px">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="White" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<!-- End Data Tables--> <asp:DataGrid ID="DataGrid_05" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 134px; position: absolute; top: 998px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="Crimson" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_06" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 130px; position: absolute; top: 1176px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="Pink" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_07" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 123px; position: absolute; top: 1346px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="Orchid" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_08" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 125px; position: absolute; top: 1506px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="LightBlue" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_09" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 124px; position: absolute; top: 1668px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="DarkOrange" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
<asp:DataGrid ID="DataGrid_10" runat="server" Font-Names ="Arial" Font-Size="8pt" CellPadding="2"
AutoGenerateColumns="False" Width="65%" BackColor="#EEEEEE" HorizontalAlign="Left" DataKeyField="lng_id" AllowSorting="True" caption="Platform Strutural Bad" captionalign="Left" useaccessibleheader="True" style="left: 122px; position: absolute; top: 1822px" Height="7px" Visible="False">
<selecteditemstyle BackColor="Yellow" />
<AlternatingItemStyle BackColor="YellowGreen" />
<HeaderStyle BackColor="#EEEEEE" Font-Bold="True" Font-Names="Arial" ForeColor="Black"
HorizontalAlign="Left" />
<columns>
<asp:BoundColumn DataField="Facility" HeaderText="Facility"></asp:BoundColumn>
<asp:BoundColumn DataField="Item" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="Item Desc" HeaderText="Type"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Comments">
<itemstyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False"
Font-Underline="False" HorizontalAlign="Left" />
<itemtemplate>
<%# GetStrippedComments(Convert.ToString(DataBinder.Eval(Container.DataItem, "Comments"))) %>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Photos">
<itemtemplate>
<asp:HyperLink ID="Photos" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Photo") %>'
Target="_blank"> <img src="Images/Camera-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Drawings">
<itemtemplate>
<asp:HyperLink ID="Drawings" runat="server" NavigateUrl='<%# GetImagesPath(DataBinder.Eval(Container.DataItem, "lng_id").ToString(),"tbl_pl_anomaly","Drawing") %>'
Target="_blank"> <img src="Images/Drawing-01.gif" alt="" border="0" /> </asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Submit">
<itemtemplate>
<asp:CheckBox ID="chkAnomaly" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</td>
</tr>
</table>
<!--<asp:TextBox ID="TextBox_Hidden_Group" runat="server" Height="19px" Style="left: 736px;
position: absolute; top: 384px" Visible="False" Width="83px" BackColor="Red"></asp:TextBox>
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Images/ads.xml"
AlternateTextField="Images from latest inspection" BackColor="White" Height="94px"
ImageUrlField="" NavigateUrlField="" Style="left: 347px; position: absolute;
top: 722px" Width="156px" />
<asp:Menu ID="MenuHorizontal" runat="server" BackColor="Navy" Font-Names="Arial" ForeColor="White"
Orientation="Horizontal" Style="left: 453px; position: absolute; top: 451px"
Width="645px" OnMenuItemClick="MenuHorizontal_MenuItemClick"> <Items> <asp:MenuItem Text="Reports" Value="Reports"> <asp:MenuItem Text="ReportsTopside" Value="ReportsTopside"></asp:MenuItem> <asp:MenuItem Text="ReportsUnderwater" Value="ReportsUnderwater"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Export" Value="Export"> <asp:MenuItem Text="ExportTopside" Value="ExportTopside"></asp:MenuItem> <asp:MenuItem Text="ExportUnderwater" Value="ExportUnderwater"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Downloads" Value="Downloads"></asp:MenuItem> <asp:MenuItem Text="Photographs" Value="Photographs"> <asp:MenuItem Text="PhotographsTopside" Value="PhotographsTopside"></asp:MenuItem> <asp:MenuItem Text="PhotographsUnderwater" Value="PhotographsUnderwater"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Drawings" Value="Drawings"> <asp:MenuItem Text="DrawingsTopside" Value="DrawingsTopside"></asp:MenuItem> <asp:MenuItem Text="DrawingsUnderwater" Value="DrawingsUnderwater"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Videos" Value="Videos"></asp:MenuItem> </Items> <StaticMenuStyle BackColor="Navy" /> <StaticSelectedStyle BackColor="Navy" ForeColor="White" /> <StaticMenuItemStyle BackColor="Navy" /> <DynamicHoverStyle BackColor="White" BorderColor="Navy" BorderStyle="Outset" ForeColor="Navy" /> <DynamicMenuStyle BackColor="Navy" /> <DynamicSelectedStyle BackColor="Navy" /> <DynamicMenuItemStyle BackColor="Navy" /> <StaticHoverStyle BackColor="White" ForeColor="Navy" /> </asp:Menu> <asp:Menu ID="Menu_Vertical" runat="server" BackColor="Navy" BorderColor="White"
BorderStyle="Solid" BorderWidth="0px" Font-Names="Arial" ForeColor="White" Height="184px"
Style="z-index: 1; left: 6px; position: absolute; top: 223px" Width="103px" OnMenuItemClick="Menu_Vertical_MenuItemClick"> <StaticMenuStyle BackColor="Navy" BorderStyle="Inset" /> <StaticSelectedStyle BackColor="White" BorderStyle="Inset" ForeColor="Navy" /> <StaticMenuItemStyle BackColor="Navy" BorderStyle="None" ForeColor="White" /> <DynamicHoverStyle BackColor="White" ForeColor="Navy" BorderColor="Navy" BorderStyle="Outset" /> <DynamicMenuStyle BackColor="Navy" BorderStyle="None" /> <DynamicSelectedStyle BackColor="White" BorderStyle="Inset" ForeColor="Navy" /> <DynamicMenuItemStyle BackColor="Navy" ForeColor="White" /> <StaticHoverStyle BackColor="White" BorderStyle="None" ForeColor="Navy" /> <Items> <asp:MenuItem Text="Login" Value="Login"></asp:MenuItem> <asp:MenuItem Text="User Account" Value="User Account"> <asp:MenuItem Text="My Account Settings" Value="My Account Settings"></asp:MenuItem> <asp:MenuItem Text="Create Users" Value="Create Users"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Activity Log" Value="Activity Log"> <asp:MenuItem Text="Action Items" Value="Action Items"></asp:MenuItem> </asp:MenuItem> <asp:MenuItem Text="Logout" Value="Logout"></asp:MenuItem> </Items> </asp:Menu> <asp:Menu ID="Menu1" runat="server" Height="60px" Style="position: absolute; background-color: green; left: 555px; top: 705px;"
Width="295px"> <Items> <asp:MenuItem Text="aa" Value="aa"></asp:MenuItem> <asp:MenuItem Text="bb" Value="bb"> <asp:MenuItem Text="cc" Value="cc" ></asp:MenuItem> </asp:MenuItem> </Items> </asp:Menu>-->
</form></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>