ASP_Beginner needs help !
-
I need to create an web page interface for a database in ASP.NET with C# and I have some problems : 1. First of all how can I connect to the database and how can I make queries. Sould I use the "DataSource" control or is it better to connect with code only ? (The database is on my PC) 2. As I can see there are two types of buttons. The first is the standard that leads to write code in the *.aspx.cs file. The second is the HTML button that leads to write code in the *.aspx file. The first button however is invisible in my browser. Why is that ? If you could tell me how to connect to my database in an MFC project instead of ASP and how to make queries it would be nice too. I was really disapointed that noone in this site hasn't posted an article on this matter (Am I wrong?). Anyway, this is the best programming site there is. Any kind of help would be much appreciated.
kostas KEL
-
I need to create an web page interface for a database in ASP.NET with C# and I have some problems : 1. First of all how can I connect to the database and how can I make queries. Sould I use the "DataSource" control or is it better to connect with code only ? (The database is on my PC) 2. As I can see there are two types of buttons. The first is the standard that leads to write code in the *.aspx.cs file. The second is the HTML button that leads to write code in the *.aspx file. The first button however is invisible in my browser. Why is that ? If you could tell me how to connect to my database in an MFC project instead of ASP and how to make queries it would be nice too. I was really disapointed that noone in this site hasn't posted an article on this matter (Am I wrong?). Anyway, this is the best programming site there is. Any kind of help would be much appreciated.
kostas KEL
Hi, It is not possible to write about details of Database connectivity in .NET in this reply. I am giving you a few hints. Using a good book and googling will show you the way. Important namespaces for connectivity and data related activity.
System.Data.SqlClient
- for Sql ServerSystem.Data.OracleClient
- for OracleSystem.Data.Odbc
- for other database.System.Data
Please read about these namespaces. Read aboutSqlConnection
,SqlCommand
andSqlDataAdapter
inSystem.Data.SqlClient
. Similar classes also exist for other namespaces. Apart from it you need to know aboutDataSet
,SqlDataReader
etc.Pradipta Basu
-
I need to create an web page interface for a database in ASP.NET with C# and I have some problems : 1. First of all how can I connect to the database and how can I make queries. Sould I use the "DataSource" control or is it better to connect with code only ? (The database is on my PC) 2. As I can see there are two types of buttons. The first is the standard that leads to write code in the *.aspx.cs file. The second is the HTML button that leads to write code in the *.aspx file. The first button however is invisible in my browser. Why is that ? If you could tell me how to connect to my database in an MFC project instead of ASP and how to make queries it would be nice too. I was really disapointed that noone in this site hasn't posted an article on this matter (Am I wrong?). Anyway, this is the best programming site there is. Any kind of help would be much appreciated.
kostas KEL
KEL3 wrote:
First of all how can I connect to the database and how can I make queries.
Small question, big answer - people have written entire books answering that question. Get a book on ADO.NET. Personally, I use SqlConnection and SqlCommand and the Enterprise Libraries.
KEL3 wrote:
As I can see there are two types of buttons. The first is the standard that leads to write code in the *.aspx.cs file. The second is the HTML button that leads to write code in the *.aspx file. The first button however is invisible in my browser. Why is that ?
I don't know. You need to post some code. The "standard" buttons work for me. Have you set any properties that would make it invisible?
KEL3 wrote:
If you could tell me how to connect to my database in an MFC project instead of ASP and how to make queries it would be nice too.
Off topic - ask this in the C++ forum.
KEL3 wrote:
I was really disapointed that noone in this site hasn't posted an article on this matter (Am I wrong?).
Umm.. Did you try searching for any? I typed in "connect database MFC" into the search facility here and I got back 36 possible articles that you might find useful.
Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos