Using parameters in querying an Access DB and using Datasets

Once a user has logged into my application, they are directed to their admin page.  On there, it will display if they have any new messages.  I can assign the login name to the variable "yourname".

The messages are stored in the unimaginatively titled 'messages' table.  The msgto and msgfrom fields are linked to the 'logins' table where the names are stored.

 So far, I have created a tableadapter and have the query that will list the required fields for all the messages that are unread:

SELECT     messages.messID, messages.[timestamp], messages.importance, messages.msgread, messages.replied, messages.msgsubject,
                      messages.msgbody, logins.username
FROM         (logins INNER JOIN
                      messages ON logins.loginid = messages.msgto)

My problem is that I want to add a filter along the lines of WHERE msgto = the yourname value.

 

Cheers

Mark

 

0
bigyeti
12/14/2007 7:10:20 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

3 Replies
860 Views

Similar Articles

[PageSpeed] 37

Can you try the following article ? http://msdn2.microsoft.com/en-us/library/k14b54kc.aspx


Das (http://aspalliance.com/author.aspx?uId=697)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dont forget to click "Mark as Answer" on the post that helped you. This marks your thread as Resolved so we will all know you have been helped.
0
datagrid
12/14/2007 8:57:23 PM

This should help: Parameter Queries in ASP.NET with MS Access

 


Regards Mike
[MVP - ASP/ASP.NET]
My site
0
Mikesdotnetting
12/14/2007 8:58:27 PM

Thanks for that.  However, I have a problem accessing the Table Adapter.

On the "Get Started" page, there's a video detailing how to create a ToDo List featuring AJAX.  I followed the video, and it worked great.  I then tried to implement similar data access in my own app, and it's not working.

I created a .xsd DataSet.  The query works fine, with the parameter problem above sorted.  I can preview the data and everything's good.

However, I then go back into my webpage, add a Gridview, go into design view and create a new Object Data Source, just as he did in the video.

However, when it comes to "Choose a Business Object" (as seen at 8:01 in the video), the dropdown list is empty and I can't select my table adapter.

Where have I gone wrong?

Mark

0
bigyeti
12/16/2007 3:02:54 PM
Reply:

Similar Artilces:

Using the AS in a SQL query accessing an Access DB
Hello, I'm using a Asp.Net GridView for the first time and am VERY pleased with how easy it is to set up. However, I'm running into a couple of simple problems. First, my query looks like this: sql.Append("SELECT DISTINCT a As 'something somthing' ...") My problem is that when I view the grid, the single quotes actually show up. When I eliminate them, no results are found (because of the spaces). How do I get around this? Also, I selected the features Edit and Delete in the GridView (using VWD Express). How do I go about actually implementing those? I am g...

Operation must use an updateable query error when using Access db
I am developing an ASP .NET application at work (Windows 2000 Pro, Access 2000) and have been taking a copy of it home to test. When I run the application at home (Windows XP Pro, Access XP) I can log into the app and display DataGrids, which means I can read data in tables. If I try to update data in a table I get a "Operation must use an updateable query" error. As far as I know, the IIS is configured the same on the two machines. The only differences are the operating systems and the version of MS Access. Any suggestions would be appreciated.Regards, Jim Bonacorda Train H...

FIX: Operation must use an updateable query
See this thread: http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=141946 EDIT: ----------------------------- 27th of December 2004 See also this KB article: PRB: Cannot connect to Access database from ASP.NET http://support.microsoft.com/kb/q316675/ If using Windows Server 2003 (IIS 6), note this: http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=209050 -----------------------------Thanks,Teemu KeiskiFinland, EU When I don't want to mess with permissions, I simply transfer the site on a FAT partition. Otherwise, you'd have to do what the others have suggeste...

Linking Access Db tables to a different Access Db using the Internet.
I am looking for the simplest way in ms Access to link up to tables in a different Access database (using ASP or not). It works in a LAN, now I want to use the internet instead. If possible without inviting a heavy load of redundant features. Anybody willing to advice?Robert...

What is the use and advantage of using DataAdaptor+DataTable over direct DB access ?
What is the use and advantage of using DataAdaptor+DataTable over direct DB access ?   Any good document ? Thanks Well, the DataTable is an in-memory cache of a database table. It is faster to have all the data in memory and it as a fairly complete and powerful class to work with data without the need to round-trip to database for every action, but on the other hand if the amount of data is high, it is not scalable. In this situation it is better to access the database directly.Reza Nassabehwww.professionalcsharp.comDon't forget to click "Mark as Answer" on the post t...

Query Access DB and use result in code
HelloSorry for what might be a newbie question. What I want to achieve is the following:when my page loads I want to perform a query against an Access db.The query will result in 2 value, I want to use this values in other parts of my codeso basically I want to end up with 2 string values. E.g. Str1 = AccessDBQueryResult1Str2 = AccessDBQueryResult2 Shall I code the DB connection all together (and if yes, how do I write it)orshall I make use of the AccessDataSource control (and if yes, how do I "extract" the results from the query into 2 string values). Thanks in advance. Best regardsP...

Using DSN to access ASE12.5 database from a MS ACCESS DB
I recently installed a Sybase ASE12.5 server. After that, I was able to set up an ODBC DSN. However, when I created a hot link from my ACCESS db, I was able to see the table list displayed. I then selected a table, and click on the 'OK' button, immediately I received the following error: Reserverd error (-7747): there is no message for this error. My machine is a WIN2000 machine. I have done the same thing for ASE11.9 and ASE12.0 and have never run into this problem. So, can someone ran into the same probelm and have solution? -- Peter Lo peter.lo@tra...

Using DSN to access ASE12.5 database from a MA ACCESS db (WIN2000)
Yes, I have a table called 'function' which is a keyword in ASE12.5. However, in the database I tried to connect to, I have renamed the 'function' table to other name. I turned on the trace for ODBC and retried again. Here is what I captured in SQL.LOG when I selected the table 'account_ext_info': ============================================================================ === MSACCESS 448-414 EXIT SQLGetData with return code 0 (SQL_SUCCESS) HSTMT 07E41798 UWORD 6 SWORD -8 <SQL_C_WCHAR> PTR 0x0012B550 [ 32] "account_ext_inf...

Best way to access the database and set up queries using .net
Hi I'm using web pages to extract information from my database. At the moment, I can either use the server explorer and toolbox data to create my connection and adapter or I can code directly without setting up this database connection. What's the best way to do this? When I code directly I have the database contained in a folder within my .net project - I took this over from someone else who'd done it that way. But when I started looking in books I saw that the database connection was displayed in the server explorer which is looking on my c: drive. Eventually the databa...

How do you enter Stored Procedures in VB.NET (Using Access DB)??
I'm using Microsoft Access 2003 and I'm using VB.Net. I'm trying to save a Stored Procedure for the application but when I enter the code into the SQL view of MS Access Query area it throws back errors. The Stored Procedure I'm trying to use is as follows:CREATE PROCEDURE dbo.CheckPassword(  @username Varchar(20)  @password Varchar(20))ASIf Exists(  Select User_ID from UserList Where User_Username = @username And User_Password = @password)Return 0 You must run the SQL command over oledb. You dont.  Microsoft Access Does not support Stored Procedures.  Yo...

Connect Remote server MS Access DB with .Net using DSN
 Hi,Connect Remote server MS Access DB with .Net using DSN .My code is: String ss = "Provider=MS Remote;Remote Server=http://serverName:1433; Remote Provider=Microsoft.Jet.OLEDB.4.0;DSN=Test;";                   OdbcConnection con = new OdbcConnection(ss);        con.Open();        Response.Write("Connected");when i try to access, i am getting the following error ERROR [IM002] [Microsoft][ODBC Driver Mana...

Using Access as DB
Hi Friends : By the current time Im making a test using Access.It works fine, but I would like to know the needed files to make the deployment of the executable and its needed drivers. Please give a me a clue of how to do it, cause I was searching for the info on Sybase site but without success. Thanks a lot, Javier Barbieri You might have better luck searching the Microsoft Web site......................... "Alessandro Barbieri" <javier@barron.com.pe> wrote in message news:8sG4TyBJBHA.275@forums.sybase.com... > Hi Friends : > > By the curre...

Issue Tracker [ACCESS db] -ERROR: Operation must use an updateable query.
I encounter the error above while running the IssueTracker using Access Database version of VB VS =============================== [OleDbException (0x80004005): Operation must use an updateable query.] System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32 hr) +41 System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +174 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +92 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)...

Populating a dataset with more than one tables of MS ACCESS database using a single query,
Hi friends, I am trying to populate the dataset with more than one tables of MS Access database but I do not know the query. I have used "select * from pets;select from emp_test" but there is an error that characters found after SQL statement. Please help me to figure out the solution  You will need to run a separate Select command to populate each datatable, as Access doesn't can't handle batch commands in the same way that SQL Server does. Regards Mike [MVP - ASP/ASP.NET]My site...

Web resources about - Using parameters in querying an Access DB and using Datasets - asp.net.access-datasource

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what? www.seroundtable.com/archives/017105.html

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 12/17/2015 9:24:58 PM