469,323 Members | 1,297 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

Fetching data from User

Hi I want to know how data is fetched from web page & stored in sql data base. I have the design of webpage but cannot save data in sql table. please help!
Sep 19 '07 #1
1 1187
shweta123
692 Expert 512MB
Hi,

What platform are you using? Is it a .Net?

If it is Asp and Sql Server then you can try this code
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Dim Con 
  3. Dim Sql
  4.  
  5. Set con=Server.CreateObject("Adodb.Connection")
  6.  
  7. 'Here comes your connectionstring
  8.  
  9. Con.ConnectionString = "Provider=SQLOLEDB.1;............ "
  10.  
  11. 'Open the connection
  12. Con.open
  13.  
  14. ''''''Fetch the values from page e.g.
  15.  
  16. Dim myName
  17. Dim myNo
  18.  
  19. myName = Request.Form("Textbox1")
  20. myNo = Request.Form("Textbox2")
  21.  
  22.  
  23. ''''''''Insert data into db.
  24.  
  25. Sql = "Insert into tablename(No,Name) values(myNo,myName)"
  26.  
  27. Con.execute(Sql)
  28.  
  29. Con.close
  30.  
  31. %>
Sep 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Srinivasan R | last post: by
1 post views Thread by nasirmajor | last post: by
22 posts views Thread by Sandman | last post: by
4 posts views Thread by tokcy | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.