PrincessAmidala wrote: > im having a problem with passing parameters(input) to queries that im > going to use to display data in a datagrid or data list/combo. What i > want to do is to get input from a textbox, check the value from a > query, and show only related information regarding that input in the > data grid.. The problem is,it shows all the records in that specific > table.. * ****anyone HELP.. i badly need this for my thesis > project...***** im using msaccess & ms VB An example of your SQL statement would be helpful. In the meantime, the usual way to create a parameterized query is to use the syntax like this: Select fielda, fieldb from file1 where fieldc = ? How that parameter holder's value is specified depends upon the lanquage. In your instance I believe you will find that there is a parameter collection object. Bill
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
use of parameterized queries
Collapse
X
-
use of parameterized queries
im working on an enrollment system of a certain music school. i wld want to view the schedule of a student in a certain class(instrument)in a datagrid. all data come from different tables in the database: tblSTUDENT -> tblEnrollment -> tblSchedule how can i check the value of a textbox that will be used to enter the student's id to the condition in the SQL statement? can you give me some examples? thank you very much... :>
Code
-
use of parameterized queries
PrincessAmidala wrote: > im working on an enrollment system of a certain music school. i wld > want to view the schedule of a student in a certain > class(instrument)in a datagrid. all data come from different tables > in the database: Ah, I thought you were dealing with data from the 400, but this is a straight PC application. I haven't done this type of programming before, but would this work? SELECT tblEnrollment.class, tblSchedule.day, tblSchedule.time FROM tblStudent, tblEnrollment, tblSchedule WHERE tblStudent.studId = tblEnrollment.studId AND tblEnrollment.enrollNum = tblSchedule.enrollNum AND tblStudentId = txtboxField.Value ; Bill
Comment
-
use of parameterized queries
Here is an article on Microsoft's MSDN site that shows examples using parameterized queries. http://msdn.microsoft.com/library/de...ml/sa00e19.asp
Comment
-
use of parameterized queries
Thank you for responding to my problem.. I already have a way to find a solution with my previous problem. What my problem now is what control is appropriate to show the result of the ".FIND" method (for recordsets) i used to find a certain value among the data in my table. If i am going to use the Datagrid, my problem is how am i going to show the data?
Comment
-
use of parameterized queries
You don't say if you are using .Net or not, but since you are in school I will assume you are using .Net. Typically, you would create a dataAdapter object to fill your DataSet object. The dataAdapter accepts both a connection string and a command string (your SQL statement with where clause.) Once you have a DataSet, you can bind a DataGrid to it by setting the DataSource property to the DataSet.
Comment
-
use of parameterized queries
im having a problem with passing parameters(input) to queries that im going to use to display data in a datagrid or data list/combo. What i want to do is to get input from a textbox, check the value from a query, and show only related information regarding that input in the data grid.. The problem is,it shows all the records in that specific table..[*]****anyone HELP.. i badly need this for my thesis project...***** im using msaccess & ms VB
Comment
-
use of parameterized queries
Here is another MSDN link that should help you: http://msdn.microsoft.com/library/de...mpletopics.asp Best of luck.
Comment
Comment