i am new with asp.net and i would like to start with it!!!
I was wondering if anyone could suggest me any good and easy to understand tutorial where i can learn how to make a list from sql and edit the record in a new page (add, update, delete records.. etc, etc)
If someone is so kind to send me some code already done, will be greate!!! (at : email@example.com)
I don't believe that you can't find your tutorials through google or youtube.
There's so many sample and tutorials. Try doing your research, once you are stuck at somewhere, you are welcome to ask us.
I actually found something but i don't understand why all the example fill the label with data or datagrid or dataview... can i fill with simple text html??
I mean, i have my connection to sql, how can i show the records of my table ("users") making my own list design?
Another question, i saw that visual web express allows you to create automatically a login user with editing etc etc, how can i do this by my self? with classic asp i was using cookies, but with asp.net c# it looks different.. how can i save my variables taken from my sql database? (cookies, sessions or others?) is there anybody who can give me some code already done to study?
why all the example fill the label with data or datagrid or dataview...
because these rich controls are supposed to help you develop quicker.
can i fill with simple text html??
yes of course. In your code behind, you can read from the database and construct the HTML (during the reading/looping process) then insert that HTML most likely in a placeholder control.
visual web express allows you to create automatically a login user with editing etc etc, how can i do this by my self?
You would have to code itas you did when working with Classic ASP. Using textbox controls to capture username and password, then logic to take that information and find a match in your users table. If you find a match, store the information in a session/cookie. Before you do that, research forms based authentication. Its not the full blown automated thingy you are referring to, but does allow you to manually build the login stuff and just use a few built-in methods and web.config to manage the cookie and security where users are allowed to access.
how can i save my variables taken from my sql database? (cookies, sessions or others?)
yes those are common methods. If you only need to store the data for the duration of the session, a session variable can be used. If you need to store it past the legth of the session, you can use a cookie.
is there anybody who can give me some code already done to study?
What code are you looking for? In any case, its really hard to take someone's code and learn directly from it. I think the best approach is to go through turorials from a book, online resources, do examples, etc...
You just have to change the MSJDatabase.mdf to yours database name. P/S (i only know MySQL)
public partial class Webform1 : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionString["<dataname name where you declared in web.config>"].ConnectionString;
SqlConnection cmd = new SqlConnection(" //Your sql query ", con);
//If you want compare your database value with controls, example
SqlConnection cmd = new SqlConnection("SELECT * FROM Customer WHERE CustomerName=@name", con);
//Remember, must open the connection first before you fire your query. When after finish use remember to close it.
//if your sql query is SELECT statement
SqlDataReader dtrRead = cmd.ExecuteReader();
//if your sql query is non-SELECT statement
//at last close your connection