Add News From SQL database

Posted by Naeem2049 under ASP.NET on 12/28/2010 | Points: 10 | Views : 2772 | Status : [Member] | Replies : 18
Hi,

I want to Add news in my website from SQL database.

I am using Tabs Control to view News in it i.e Tab1 have local News,Tab2 have company news like this.

News have these fields in Database (News Tittle,News Image,News Description ). So, i have no idea how to Add news dynamically in my website through News Control.

Please help me in this senario.

Advance thanks for help.

Regards
NAEEM




Responses

Posted by: Jayeshl on: 12/28/2010 [Member] Starter | Points: 25

Up
0
Down
for that create different object for newsControl

like this

Control objControl = (Control)ControlName("path/ControlName");

where Control is predefined in Dotnet
ControlName that is name of your control and
"path/ControlName" i.e the actual psychical path of control


thanks

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 12/29/2010 [Member] Starter | Points: 25

Up
0
Down
Hi,

Thanks for reply me in this scenario.

Sorry still i am not clearly understand the logic . would you Please like to send any example or share some details on it from which i can easily understand the problem .

Advance Thanks for Help


Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/1/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

Thanks for reply me in this scenario.

Sorry still i am not clearly understand the logic . would you Please like to send any example or share some details on it from which i can easily understand the problem .

Advance Thanks for Help

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/7/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Try this link

http://www.c-sharpcorner.com/uploadfile/munnamax/scrollingnews02252006101507am/scrollingnews.aspx

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/7/2011 [Member] Starter | Points: 25

Up
0
Down

Hi,

Thanks for this link

Thanks
NAEEM

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/7/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi NAEEM,

Does your issue fixed?

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/8/2011 [Member] Starter | Points: 25

Up
0
Down

Hi Karthik,

Not complete, because i can't understand the logic which he has been used. Also i want to add new pics with this . I read this many time but confused to understand it.
Please refer some links which are complete means have full and complete code example.

Thanks for advance help.

Thanks
NAEEM



Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/8/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi Naeem,

The code login explained in the link is straight forward, you need to add one more column in the table to store the image and use the same concept.

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/9/2011 [Member] Starter | Points: 25

Up
0
Down

Hi Karthik,

I follow the link n got the solution for scrolling the news but still news image is not coming with news title n details.

In this example i have used two SQL tables tbl_News and tbl_NewsDetails. I confused where add news image whether to add this in tbl_News or in tbl_NewsDetails
because Image also come with news and also with news detail.

This is hard Coded Example from which we go to DB n Add or change from DB. But i want this through Web Form as dynamic Control to Add n Change News details from news form.

Please help me in this .
I solve the 80% problem still 20% remains

Thanks for your coordination in this issue.

Regards
NAEEM

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/9/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi Naeem,

Good to see you completed the 80%....

To dig into deep... what are the columns u kept in tbl_News and tbl_NewsDetails. thr shld be a common link between the tables when you have normalized the tables...

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/12/2011 [Member] Starter | Points: 25

Up
0
Down

Hi Karthik,

I have done this but still problem of image storing logic........

Question is how i can save Image in database means datatype of image field.... if we save image in database it will increase the database size .....

Is there any idea to add images in the project Directory not directly in the database only file name and path of the image will be store in the database this will not increase the database size......

This is my suggestion i am not confirm whether this is true or false ........

Please help me in this scenario with some useful example.......

Thanks a lot in Advance..............

Regards
NAEEM

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/12/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Yes its possible naeem, you can save it in a virtual path and map the path in ur SQB db and when trying to retrive make use of that path and get the image.... this is very good indeed to maintain the size of the db...

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/12/2011 [Member] Starter | Points: 25

Up
0
Down

Hi Karthik,

Thanks...

Regards
NAEEM

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/12/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Welcome Naeem,

Let me know in case of any help needed...

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naeem2049 on: 1/13/2011 [Member] Starter | Points: 25

Up
0
Down

Hi Karthik,

I there any example available according to this scenario to add images with other details in DB and retrieve this detail......

I think any example will help better to solve this problem......

please share example source on this .......

Thanks

NAEEM

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/13/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Try this link... it has the code

http://stackoverflow.com/questions/1833506/retrieving-images-using-a-file-path-stored-in-a-sql-database-nearly-there



Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/13/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
this sample is for storing into db and retriving the image directly in both VB.net and C#

http://www.dotnetcurry.com/ShowArticle.aspx?ID=129&AspxAutoDetectCookieSupport=1

Thanks
Karthik
www.f5Debug.net

Naeem2049, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response