Hi. Yes, I think it is a data type problem. I just don't have the experience to replicate the various bits of code to deal with dates. There are dates in the classified starter kits, but they are all calculated dates. None is a direct user input date
which is what I was trying to do.
I know I may regret my "cop out" later. However, the purpose of the dates is only for sorting/searching and I'm hopeful I'll be able to use the separate fields as integers for that purpose. In any event, I just ran out of time. My website was effectively
off the air for over a week and I had to get it back somehow.
Thanks again for your help. Even when I don't entirely understand the answer, it is so helpful to know there is somewhere I can go to ask.
Go into the database and check the Views - which is where the search function is going against. You'll have to add the two date columns to the View definition.
Bev, it's not a datatype problem, just a user problem ;) After you add the extra columns to GetActiveAdsByQuery(), you'll have to add the sameto GetAdsByQuery(),and GetAllAdsByQuery() in your code (the Ads.cs) file. You'll then have to load the Ads Adapter
in the Designer and locate the GetAllAdsByQuery method and add the extra parameters to the call using the Parameter Collections Editor. Next to last, you'll have to add them to the stored procedure GetAllAdsQuery. Finally - and this is most likely why your
search is crashing, the sp is SELECTing from a View classifiedsView_Ads , which means you'll have to alter the View's definition to add the two date columns in the SELECT statement so that they shouw up in the result set for the procedure to use. Tha's why
you're not finding anything (bcs the View is the missing link here). Since they aren't there to begin with, the application is having a fit because it can't reconcile two variable you added with anything it's getting back from the database. I know it's sounds
complicate and overwhelming, but take it step by step, trace your program call from Search->Ads->Ads.xsd->StoredProc->View->StoredProc->ObjectDataSource(ie, Ads.xsd)->Ads->Search.
Take a look at the MinDateCreated columns to see how the application is going about using dates. You can use the same logic for you Start/End dates conditions.
Also, try to not to modify ads.xsd by handle unless you know exactly what you're doing. Work with that file with the appropriate designer, it'll result in fewer headaches down the road.
redwoodbev
Member
29 Points
166 Posts
Re: Error in Search.aspx.vb after adding date columns in database
Feb 09, 2010 02:33 AM|LINK
Hi. Yes, I think it is a data type problem. I just don't have the experience to replicate the various bits of code to deal with dates. There are dates in the classified starter kits, but they are all calculated dates. None is a direct user input date which is what I was trying to do.
I know I may regret my "cop out" later. However, the purpose of the dates is only for sorting/searching and I'm hopeful I'll be able to use the separate fields as integers for that purpose. In any event, I just ran out of time. My website was effectively off the air for over a week and I had to get it back somehow.
Thanks again for your help. Even when I don't entirely understand the answer, it is so helpful to know there is somewhere I can go to ask.
ScottV.
Member
50 Points
15 Posts
Re: Error in Search.aspx.vb after adding date columns in database
Aug 26, 2010 03:41 AM|LINK
Go into the database and check the Views - which is where the search function is going against. You'll have to add the two date columns to the View definition.
Regards,
Scott
ScottV.
Member
50 Points
15 Posts
Re: Error in Search.aspx.vb after adding date columns in database
Aug 26, 2010 04:12 AM|LINK
Bev, it's not a datatype problem, just a user problem ;) After you add the extra columns to GetActiveAdsByQuery(), you'll have to add the sameto GetAdsByQuery(),and GetAllAdsByQuery() in your code (the Ads.cs) file. You'll then have to load the Ads Adapter in the Designer and locate the GetAllAdsByQuery method and add the extra parameters to the call using the Parameter Collections Editor. Next to last, you'll have to add them to the stored procedure GetAllAdsQuery. Finally - and this is most likely why your search is crashing, the sp is SELECTing from a View classifiedsView_Ads , which means you'll have to alter the View's definition to add the two date columns in the SELECT statement so that they shouw up in the result set for the procedure to use. Tha's why you're not finding anything (bcs the View is the missing link here). Since they aren't there to begin with, the application is having a fit because it can't reconcile two variable you added with anything it's getting back from the database. I know it's sounds complicate and overwhelming, but take it step by step, trace your program call from Search->Ads->Ads.xsd->StoredProc->View->StoredProc->ObjectDataSource(ie, Ads.xsd)->Ads->Search.
Take a look at the MinDateCreated columns to see how the application is going about using dates. You can use the same logic for you Start/End dates conditions.
Also, try to not to modify ads.xsd by handle unless you know exactly what you're doing. Work with that file with the appropriate designer, it'll result in fewer headaches down the road.
Regards,
Scott