Last post Aug 09, 2007 09:57 PM by darkknight187
Apr 22, 2007 07:52 PM|robinwilliams|LINK
If you have a look in the ShowAd.aspx.vb code, you will notice you can type in something like,
Label1.text = ad.EpirationDate or
Label2.Text = ad.NumViews
What I wold like to do is add more options to that ad. part, like
ad.PhoneNumber or ad.EmailAddress
Does anyone know how to access this? I know you will need to add more rows to the
classifieds_Ads table, I changed the GetAdById
stored procedure, but still isn;'t working??
What code do you think I need to change in order to get to that ad.
part? Do I need to change the AdsTableAdapter ?
Apr 22, 2007 11:11 PM|darkknight187|LINK
I don't know what Adapter your talking about but you have to change around 10 main files, as well as Postad.aspx & UpdateAd.aspx.
The 10 starting in the database are of course in the "Tables" Database add your new catagories,
(I started out by copying the code for AdType and Location)
2: In the Views folder "ClassifiedsView_Ads" Check the empty boxes next to your new addition.
3: "Stored Procedures" There's a lot here so here they are GetAdById, GetSavedAds, InsertAd, RelistAd, UpdateAd.
4: Now in the Solutions Explorer (I'm working off of VWD) go in App_Code folder, into BLL folder and change Ads.vb.
5: Now into DAL and into Ads.xsd, add your new addition, don't forget to change the properties of your new column after you insert it.
(NOW THIS PART IS VERY IMPORTANT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
Still in Ads.xsd after you save, right click and choose view code.
This file needs to be modified as well but you must be entering your new code in the same order, ie (1)(2)(3)(4)
if you enter your new catagories in any order (1)(3)(2)(4) and then in (1)(2)(4)(3) it will end up uploading info to the wrong database column.
Your Ads page will have errors until you have them all correct.
So with that said the biggest piece of advise I can give you is copy your project folder and save it as a backup elsewhere just in case.
Good luck, if you get stuck let me know.
Aug 01, 2007 06:54 AM|r1kob|LINK
I am a little stock on the following areas of your well laid out advice, i am trying to add a telephone colum to the data base, but more imprtantly would be pleased to understand how to do this, i can see lots of diiferent applications for it ( Telephone
int not allow nulls )
(1) I started out by copying the code for AdType and Location)
1) What do you mean by the above statement ?
(4) Now in the Solutions Explorer (I'm working off of VWD) go in App_Code folder, into BLL folder and change Ads.vb.
4) what do i change in this file ?, i couldnt find anything to change at all
(5) Still in Ads.xsd after you save, right click and choose view code.
5) I get what you mean but dont understand what i am ment to be chaning, i can see the source code and there is a lot of it, but dont know what to do, ?
After following this, what next ?
thank you for your help
Aug 01, 2007 07:38 AM|r1kob|LINK
Aug 01, 2007 07:44 AM|r1kob|LINK