ASP.Net Database Connection

by Shabbir on May 2, 2008

in ASP.Net

In the previous two articles (1, 2) we explained connecting to Microsoft Access database and writing to it, in C#.

Now we do that in ASP.Net.

For start create a new ASP.Net project. First of all we are creating two labels, two text boxes and one button with the following code (add it between the <div></div> tags)

 

So, lets define the event which is invoked by clicking on the button (add it above html tag)

<script><!--mce:0--></script>

When we run the script on ASP server we will get the following page

ASP page connecting to database

By clicking the button is invoked the button1_Click event and then the data written in the text boxes is recorded to database.

Share:
  • Digg
  • Facebook
  • StumbleUpon
  • Technorati
  • Twitter

Other Related Posts

Want More Tips on How to Make Money Online?
Enter your Name and Email below to subscribe and start 1 month free course now.

Name:
Email:
You would require to confirm your email address before we send you any updates. We respect your privacy as much as you do.
Powered by Aweber
  • Awesome. just awesome...i haven't any word to appreciate this post.....Really i am impressed from this post....the person who create this post he is a great human..thanks for shared this with us.i found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me.Really the blogging is spreading its wings rapidly...
  • Great Article! Thanks for sharing very useful database connection. It will help me a lot.
  • Fahim
    well i saw your Blog its good for first level guy who is new in the hevaen of Programming.....u gave grate subtitute to use the control...hope u will post more and more.....i appreciate.
  • i am looking for same basic programming tips in asp.net and i found your blog.
    Thanks for the post
  • admin
    Thanks for your suggestion. You're right, the String.Format or StringBuilder class is good when working with strings.
    But, because this blog is for beginners I want to explain that as simple as possible.
    In the next posts I will explain the use of String and StringBuilder classes.
    So, step by step.
  • matma
    Your blog is fine for people, who writes their first programs, I think. But in this example You schould use String.Format, or even StringBuilder class, because hard coded strings is the worst thing in applications like above. Do not teach other to write code like that.

    Anyway, keep up to good work.
blog comments powered by Disqus

Previous post:

Next post:

    About the Author

  • author photo

    My Name is Shabbir Bhimani and I am developer by profession in the field of applications, web and database. Currently doing full time online marketing and like to share my experiences on how you can make money online @ CodeItWell.com. Read more ...


    See how you can get in touch with me.