Click here to Skip to main content
14,835,369 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 5:12
mveRichard Deeming21-Sep-17 5:12 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 6:33
Membersamflex21-Sep-17 6:33 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 6:39
mveRichard Deeming21-Sep-17 6:39 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 7:26
Membersamflex21-Sep-17 7:26 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 7:32
mveRichard Deeming21-Sep-17 7:32 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 8:32
Membersamflex21-Sep-17 8:32 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 8:55
mveRichard Deeming21-Sep-17 8:55 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 9:39
Membersamflex21-Sep-17 9:39 
You are such a genius!

This is incredible. You did all of this in a few minutes something I have been struggling with for days.

Even though I have not added all the records to PopulateRecord method, it is already beginning to populate MarineRegNo and the others to form.

Please bear with me for a few more questions.

On the LoadTable2 method, I am still getting error that registerNumber and bregisterNumber do not exist.

I will post entire LoadTable2 so you can tell me if I need to take that portion out.

private DataTable LoadTable2(bool createIfMissing)
{
    const string ViewStateKey = "CurrentTable";
    
    DataTable dt = ViewState[ViewStateKey] as DataTable;
    if (dt == null && createIfMissing)
    {
        dt = new DataTable();
        dta.Columns.Add(new DataColumn("RowNumber", typeof(string)));
        dta.Columns.Add(new DataColumn("boatcnty", typeof(string)));
        dta.Columns.Add(new DataColumn("aRegNo", typeof(string)));
        dta.Columns.Add(new DataColumn("aMake", typeof(string)));
        dta.Columns.Add(new DataColumn("mMake", typeof(string)));
        dta.Columns.Add(new DataColumn("ModelNoA", typeof(string)));
        dta.Columns.Add(new DataColumn("ModelNoM", typeof(string)));
        dta.Columns.Add(new DataColumn("boatYrBuilt", typeof(string)));
        dta.Columns.Add(new DataColumn("motorYrBuilt", typeof(string)));
        dta.Columns.Add(new DataColumn("blength", typeof(string)));
        dta.Columns.Add(new DataColumn("hullmaterial", typeof(string)));
        dta.Columns.Add(new DataColumn("mhorsepower", typeof(string)));
        dta.Columns.Add(new DataColumn("rdlmhorsepType", typeof(string)));
        dta.Columns.Add(new DataColumn("datePurchased", typeof(string)));
        dta.Columns.Add(new DataColumn("mdatePurchased", typeof(string)));
        dta.Columns.Add(new DataColumn("PurchaseType", typeof(string)));
        dta.Columns.Add(new DataColumn("rblmPurchasedType", typeof(string)));
        dta.Columns.Add(new DataColumn("PrevOnwerName", typeof(string)));
        dta.Columns.Add(new DataColumn("prevAddr", typeof(string)));
        dta.Columns.Add(new DataColumn("prevCity", typeof(string)));
        dta.Columns.Add(new DataColumn("PrevState", typeof(string)));
        dta.Columns.Add(new DataColumn("prevzip", typeof(string)));
        dta.Columns.Add(new DataColumn("mPrevOnwerName", typeof(string)));
        dta.Columns.Add(new DataColumn("mprevAddr", typeof(string)));
        dta.Columns.Add(new DataColumn("mprevCity", typeof(string)));
        dta.Columns.Add(new DataColumn("mPrevState", typeof(string)));
        dta.Columns.Add(new DataColumn("mprevzip", typeof(string)));
        dta.Columns.Add(new DataColumn("buyername", typeof(string)));
        dta.Columns.Add(new DataColumn("buyeraddress", typeof(string)));
        dta.Columns.Add(new DataColumn("buyercity", typeof(string)));
        dta.Columns.Add(new DataColumn("buyerstate", typeof(string)));
        dta.Columns.Add(new DataColumn("buyerzip", typeof(string)));
        dta.Columns.Add(new DataColumn("datesold", typeof(string)));
        dta.Columns.Add(new DataColumn("salePrice", typeof(string)));
        dta.Columns.Add(new DataColumn("Description", typeof(string)));
        dta.Columns.Add(new DataColumn("mbuyername", typeof(string)));
        dta.Columns.Add(new DataColumn("mbuyeraddress", typeof(string)));
        dta.Columns.Add(new DataColumn("mbuyercity", typeof(string)));
        dta.Columns.Add(new DataColumn("mbuyerstate", typeof(string)));
        dta.Columns.Add(new DataColumn("mbuyerzip", typeof(string)));
        dta.Columns.Add(new DataColumn("mdatesold", typeof(string)));
        dta.Columns.Add(new DataColumn("msalePrice", typeof(string)));
        dta.Columns.Add(new DataColumn("mDescription", typeof(string)));
        dta.Columns.Add(new DataColumn("boatCost", typeof(string)));
        dta.Columns.Add(new DataColumn("motorCost", typeof(string)));
        dta.Columns.Add(new DataColumn("rblIssues", typeof(string)));
        dta.Columns.Add(new DataColumn("functionalIsses", typeof(string)));
        dta.Columns.Add(new DataColumn("mrblIssues", typeof(string)));
        dta.Columns.Add(new DataColumn("mfunctionalIsses", typeof(string)));
        dta.Columns.Add(new DataColumn("vesseltypeUse", typeof(string)));
        dta.Columns.Add(new DataColumn("vesselname", typeof(string)));
        dta.Columns.Add(new DataColumn("vessellength", typeof(string)));
        dta.Columns.Add(new DataColumn("vesselYrBult", typeof(string)));
        dta.Columns.Add(new DataColumn("VesselHullMateria", typeof(string)));
        dta.Columns.Add(new DataColumn("vesselhorsepEngine", typeof(string)));
        dta.Columns.Add(new DataColumn("coastGuardNumber", typeof(string)));
        dta.Columns.Add(new DataColumn("VesselYrPurchased", typeof(string)));
        dta.Columns.Add(new DataColumn("PurchasedNew", typeof(string)));
        dta.Columns.Add(new DataColumn("VesselPurchaseAmt", typeof(string)));
        dta.Columns.Add(new DataColumn("homePort", typeof(string)));
        dta.Columns.Add(new DataColumn("whereDocked", typeof(string)));
        dta.Columns.Add(new DataColumn("bmequipAccessoryList", typeof(string)));
        ViewState[ViewStateKey] = dta;
    }
         if (dta.Rows.Count == 0)
        {
        DataRow dr = dta.NewRow();        
        dr["RowNumber"] = 1;
        dr["boatcnty"] = string.Empty;
        dr["ARegNo"] = registerNumber;
        dr["aMake"] = string.Empty;
        dr["mMake"] = string.Empty;
        dr["ModelNoA"] = string.Empty;
        dr["ModelNoM"] = string.Empty;
        dr["boatYrBuilt"] = string.Empty;
        dr["motorYrBuilt"] = string.Empty;
        dr["blength"] = string.Empty;
        dr["hullmaterial"] = string.Empty;
        dr["mhorsepower"] = string.Empty;
        dr["rdlmhorsepType"] = string.Empty;
        dr["datePurchased"] = string.Empty;
        dr["mdatePurchased"] = string.Empty;
        dr["PurchaseType"] = string.Empty;
        dr["rblmPurchasedType"] = string.Empty;
        dr["PrevOnwerName"] = string.Empty;
        dr["prevAddr"] = string.Empty;
        dr["prevCity"] = string.Empty;
        dr["PrevState"] = string.Empty;
        dr["prevzip"] = string.Empty;
        dr["mPrevOnwerName"] = string.Empty;
        dr["mprevAddr"] = string.Empty;
        dr["mprevCity"] = string.Empty;
        dr["mPrevState"] = string.Empty;
        dr["mprevzip"] = string.Empty;
        dr["buyername"] = string.Empty;
        dr["buyeraddress"] = string.Empty;
        dr["buyercity"] = string.Empty;
        dr["buyerstate"] = string.Empty;
        dr["buyerzip"] = string.Empty;
        dr["datesold"] = string.Empty;
        dr["salePrice"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["mbuyername"] = string.Empty;
        dr["mbuyeraddress"] = string.Empty;
        dr["mbuyercity"] = string.Empty;
        dr["mbuyerstate"] = string.Empty;
        dr["mbuyerzip"] = string.Empty;
        dr["mdatesold"] = string.Empty;
        dr["msalePrice"] = string.Empty;
        dr["mDescription"] = string.Empty;
        dr["boatCost"] = string.Empty;
        dr["motorCost"] = string.Empty;
        dr["rblIssues"] = string.Empty;
        dr["functionalIsses"] = string.Empty;
        dr["mrblIssues"] = string.Empty;
        dr["mfunctionalIsses"] = string.Empty;
        dr["vesseltypeUse"] = string.Empty;
        dr["vesselname"] = string.Empty;
        dr["vessellength"] = string.Empty;
        dr["vesselYrBult"] = string.Empty;
        dr["VesselHullMateria"] = string.Empty;
        dr["vesselhorsepEngine"] = string.Empty;
        dr["coastGuardNumber"] = bregisterNumber;
        dr["VesselYrPurchased"] = string.Empty;
        dr["PurchasedNew"] = string.Empty;
        dr["VesselPurchaseAmt"] = string.Empty;
        dr["homePort"] = string.Empty;
        dr["whereDocked"] = string.Empty;
        dr["bmequipAccessoryList"] = string.Empty;
        dta.Rows.Add(dr); 
    }
    return dta;
}


The second question I have is that I see how you assigned values to MarineRegNo and VesselRegNo.

dr["RowNumber"] = table2.Rows.Count + 1;
dr["aRegNo"] = row["MarineRegNo"];
dr["coastGuardNumber"] = row["VesselRegNo"];


Do I need to assign values from the DB to the rest like instead of this:

dr["boatcnty"] = string.Empty;


I do this:
dr["boatcnty"] = row["boatcnty"];
row["boatcnty"] is db record.

Thanks so much Richard.
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming21-Sep-17 9:47
mveRichard Deeming21-Sep-17 9:47 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex21-Sep-17 10:03
Membersamflex21-Sep-17 10:03 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 1:52
mveRichard Deeming22-Sep-17 1:52 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 3:29
Membersamflex22-Sep-17 3:29 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 3:35
mveRichard Deeming22-Sep-17 3:35 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 3:49
Membersamflex22-Sep-17 3:49 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 4:39
mveRichard Deeming22-Sep-17 4:39 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 4:56
Membersamflex22-Sep-17 4:56 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 5:09
Membersamflex22-Sep-17 5:09 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 5:35
Membersamflex22-Sep-17 5:35 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming22-Sep-17 5:43
mveRichard Deeming22-Sep-17 5:43 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 8:19
Membersamflex22-Sep-17 8:19 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex22-Sep-17 9:11
Membersamflex22-Sep-17 9:11 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming25-Sep-17 1:53
mveRichard Deeming25-Sep-17 1:53 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex25-Sep-17 3:22
Membersamflex25-Sep-17 3:22 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
Richard Deeming25-Sep-17 3:51
mveRichard Deeming25-Sep-17 3:51 
GeneralRe: Repeater2 is not getting populated with data from Repeater2. Any ideas? Pin
samflex25-Sep-17 4:20
Membersamflex25-Sep-17 4:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.