Topic: ASP help
the_wizard67's photo
Fri 12/12/08 09:38 PM
ok, let me ask a different question. I am using ASPX and don't really understand how to bind a database like Access so that I can pull in information into difference list boxes and combo boxes.

the_wizard67's photo
Fri 12/12/08 09:40 PM
Or rather if you find it easier to tell me what website that might better explain that to me I would be forever in your debt!

no photo
Fri 12/12/08 09:49 PM

ok, let me ask a different question. I am using ASPX and don't really understand how to bind a database like Access so that I can pull in information into difference list boxes and combo boxes.


Sorry, I can't help:cry: :cry:

the_wizard67's photo
Fri 12/12/08 10:19 PM


ok, let me ask a different question. I am using ASPX and don't really understand how to bind a database like Access so that I can pull in information into difference list boxes and combo boxes.


Sorry, I can't help:cry: :cry:

Thanks for taking the to atleast read it. I am a little stuck, because it isn't as close to VB2005 as I am use to. I have alot to learn, as I look at it, it takes one day at a time and one person will to share what they know.

boredinaz06's photo
Fri 12/12/08 10:37 PM


Well You Started off with "ok, let Me ask a Different Question" Then You Said a bunch of other Stuff!

adj4u's photo
Fri 12/12/08 10:41 PM
http://www.asp.net/

BrettBrett's photo
Tue 12/16/08 03:35 AM

Well You Started off with "ok, let Me ask a Different Question" Then You Said a bunch of other Stuff!

His first question was in another Topic post.


ok, let me ask a different question. I am using ASPX and don't really understand how to bind a database like Access so that I can pull in information into difference list boxes and combo boxes.


Download 'Microsoft ASP.NET Web MATRIX' for ASP.NET 1.0, 1.1 Developement

at http://www.asp.net/downloads/archived/web-matrix/default.aspx?supportsjs=true

Download 'Microsoft .NET Framework Version 3.5 SP1' AND 'Microsoft Web Developer 2008 Express Edition SP1'

at http://www.asp.net/downloads/essential/

In regards to webapp data on the page, these programs are much easier to follow, and learn from, than visual studio.

'Microsoft ASP.NET Web MATRIX' will create Access files (.mdb), create DataTables in them, and allow you to add/edit the data within the tables. It's a nice free program to have around.

They aren't really an alternative to VS though, as you can always 'ADD EXISTING ITEM' when you're done using the tools in those IDEs.


Database connections really come down Authentication and USER/GROUP(object) Permissions. Inorder for your Web Application to gain access to a sql database, the database gets attached to a SQL Server Service (which will default as a Network Service) that checks an authentication string that you have to declare/pass it. The string has to point at the database as well, and reference a dataobject type (provider). This is known as a connectionstring

If you don't have a SQL Server Service running, download SQL Server 2008 ( Express Edition )

at http://www.microsoft.com/express/sql/default.aspx

The general way to setup a connectionstring in ASP.NET is in the web.config file at the root level of your Web App( not in a subfolder on your webapp). You CAN write it to web.config files within every subfolder, but it would take tweaking the .NET framework a bit. There are .NET settings guides on how to do this. I'm not going to reference them, because if you're on the learning curve, it's best to stick with the standards.

However, a simplier way of generating your connection string is by going to the 'Server Explorer' window, right click 'Database Connections', and Click 'Add Connection'... choose the database type, browse for the file.. 'Text Connection' > Click 'Okay'

this will provide a data design mode to that database under 'Server Explorer'.

the go to your 'App_Code' folder (another .NET special folder) in Solution Explorer > Right Click > Add New Item > DataSet

Double Click the newly created File, and you will be prompted with a wizard, where you can select your database from the combobox and continue through, It will prompt to create a connectionstring at the application level, click yes. Go default on everything, except when you see the 'Query Builder' button. Click that, you will be prompted with a dialog that shows the Datatables in your database, select one and add it, then close the box and check 'All *', uncheck anything else and click okay. Then click next through the rest of the forms, and then finish.

That should generate a <connectionstring tag in your web.config

at this point, you can create a gridview control in any aspx page, Rick Click the control (design mode) > 'Show Smart Tag' > ObjectDataSource (you can try AccessDataSource here as well, I haven't)
reference your dataset.tableadapter, and continue through the wizard.



Take a look at the program: ASP.NET Web Matrix.
create a 'New File' > 'Data' category > 'Editing Grid' (toward the bottom).

When the page pops up, Go To 'View' ( at the Application Menubox ) > 'ALL'

This is a coded implementation of what you are trying to do. Connecting to a database, using sqlcommands to retrieve data, and then bind it to a control object.

the difference being..

Dim ConnectionString As String = "server=(local);database=pubs;trusted_connection=true"

is setup at your application level (web.config), using a data source (because that is the newer .NET method I believe)


Dim SelectCommand As String = "SELECT * from [DataBaseTable]" (I'm cleaning this query up a bit)

is in your TableAdapter which goes hand and hand with your Dataset, which is just a nice data-structured object that keeps your retrieved, stored data in memory for your app to use and manipulate/modify.


that should pretty much cover things.



BrettBrett's photo
Tue 12/16/08 10:15 AM
Edited by BrettBrett on Tue 12/16/08 10:36 AM
excuse me, just download 'Microsoft ASP.NET web MATRIX' and 'Microsoft Visual Web Developer 2008 Express Edition'.

'SQL Server 2008 ( Express ) SP1 x86' and '.NET Framework 3.5 SP1' are included in Microsoft Visual Web Developer 2008 Epress Edition )



NOTE:
x86 usually stands for Intel Chip Architecture, x86 family. I'm not sure if this actually means the SQL Server 2008 optional download, when installing VWD2008, is stictly for Intel Processor computers, or not. There is no difference between Pentium and Celeron, in regards to chip architecture (i.e. Assembly Code computating), I'm not sure about Intel Mobile. I am inclinded to believe there is no difference, either, as it's a standardization issue.


If you don't have an intel processor, you might want to just use the link I posted earlier to download SQL Server 2008 express.

the_wizard67's photo
Fri 12/26/08 04:25 PM
Thanks for all of the information. I found it very useful, I figured that I could use all of the same syntax for asp as I do with visual basic, but that was a mistake in some areas. I found that my main problem was that I was trying to force some of the features that have been enhanced to make it easier to build a website without writting alot of code.