Good morning DaniWeb community,

I've been coding a while in Classic ASP with MS SQL, but now it's neccesary for me to take the plunge into ASP.NET, C# in particular.

I have a lot of data in SQL, and I would like to know where to start, I know how to pass variables from the URL to a SQL Query, and retrieve it's data, but I am unsure on how to get the data from SQL bound to a "label",
Any help would be greatly appreciated,
PS: I use Visual Studio 2010 Ultimate.

Thanks in advance,
Robert de Jonge.

Recommended Answers

All 5 Replies

So, in your code behind, you can access a label control by its properties. Say in the example that you retrieved data from your data source and you want it bound to the label..for example...

label1.text = "Your string of data from your data source.";

Have you been able to setup your database connection and read data?

Thank you for answering,
I'm sorry to sound dumb, but "Your string ..." do you have an example of how it should look?

Here's another way to bind you data.

I wouldnt be able to give you a specific example of how to connect, read, and display because there are too many factors, but there are a lot of examples on line.

In your case, do a search related to "asp.net c# mysql connection"

You'll quickly find that having ASP experience is not really going to help much with regard to ASP.NET. However, you'll most likely pick it up much quicker than someone without any server side scripting experience. In your case with ASP, PHP is probably easier to pick up because of some similarities in the coding approach.

In my case, I picked up ASP.NET first, then had to learn ASP for a project I worked on, and now I wish I would have picked up PHP at the same time as ASP.NET.

Aha OK, Well thanks for pointing me in the direction that I need to go,
Thanks to both of you for your time in responding.

Regards, Robert.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.