Database Connection in Visual Studio 2005

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2006
Posts: 18
Reputation: r_jack is an unknown quantity at this point 
Solved Threads: 0
r_jack r_jack is offline Offline
Newbie Poster

Database Connection in Visual Studio 2005

 
0
  #1
Mar 9th, 2007
I developed a web interface using ASP.NET and a database using SQL Server 2005. I created connection to database using SqlDataSource control. I also used GridView control to display data. Using Visual Studio I can see the query results using a browser on a local machine. What I want now is to access the database (queries) remotely via the internet. So I need to create a button on the web interface such that when I click the button, I should then be taken to the database. (If possible I would like to make the link secure so that when the home page is accessed, and then the button is clicked, before you access the database you supply password (or username and password)). Please give me the code for this, or step by step guide to achieving this. Many thanks.
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Database Connection in Visual Studio 2005

 
0
  #2
Mar 23rd, 2007
to get the grid view to display the data then just bind the datasource you created to the grid (you can do it in the form designer in VS2005
To protect it so only logged in people can see it, either protect the whole page (use webconfig to protect different areas of your site) or use a login view control and place the grid in the logged in view.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 3
Reputation: fkatan is an unknown quantity at this point 
Solved Threads: 0
fkatan fkatan is offline Offline
Newbie Poster

Re: Database Connection in Visual Studio 2005

 
0
  #3
Mar 28th, 2007
I use visual studio 2005,sqlce & datagrid to view and edit data but I couldn't add or edit data in datagrid
would u pls. help me

thanks
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: Database Connection in Visual Studio 2005

 
0
  #4
Mar 28th, 2007
if you have bound the datagrid to the datasource and have insert, update and delete commands in your data source just set allowedit and allowdelete = true for the gridview and it will take care of it all for you. You need something seperate to add and i use the detailsview with defaultmode set to insert and bound to the same datasource.
If you want more control over the gridview when edititng etc change each bound field into a template field and then change the item, edititem and any other templates you want.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC