|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB Express - How to access query value on my form?can execute it in the Query Designer to verify that it returns the data I want. My database is called Area. It contains one table called Place. My Data Sources window shows AreaDataSet at the top, and the Places table underneath. Expanding the Places table shows me each individual column in that table. When I right-click in the Data Sources window, and choose "Edit Dataset in Designer", I get a window called AreaDataSet.xsd, which contains two boxes. One box is called "Place", and lists all the columns in my Place table, followed by a PlaceDataAdapter which contains one SQL query: Fill GetData(). The second box is called QueriesTableAdapter, and contains the SQL query I'm trying to access on my form: ScalarQuery (). When I right-click in the AreaDataSet.xsd window and choose "Preview Data", I get a popup window asking me to select an object to preview. Expanding the dropdown list, and selecting ScalarQuery (), I get AreaDataSet.ScalarQuery () as my selection, and clicking the Preview button shows me the data I want to display in my form (the column is called "Expr1"). My problem is that I don't see how to get this data in my form. The Data Sources window that's shown when my Form's Design View is displayed doesn't contain the ScalarQuery, or a QueriesTableAdapter. I'm still a VB neophyte, but I'm chipping away at it. Can somebody help me out? Hi,
Drag the AreaDataSet on the form from the datasource window. It will generate a tableadapter, datagridview, etc for you. Ken ------------------ Show quoteHide quote "spamsickle@gmail.com" wrote: > I've created a query using the Query Designer under VB Express, and I > can execute it in the Query Designer to verify that it returns the data > I want. My database is called Area. It contains one table called > Place. My Data Sources window shows AreaDataSet at the top, and the > Places table underneath. Expanding the Places table shows me each > individual column in that table. > > When I right-click in the Data Sources window, and choose "Edit Dataset > in Designer", I get a window called AreaDataSet.xsd, which contains two > boxes. One box is called "Place", and lists all the columns in my > Place table, followed by a PlaceDataAdapter which contains one SQL > query: Fill GetData(). The second box is called QueriesTableAdapter, > and contains the SQL query I'm trying to access on my form: ScalarQuery > (). > > When I right-click in the AreaDataSet.xsd window and choose "Preview > Data", I get a popup window asking me to select an object to preview. > Expanding the dropdown list, and selecting ScalarQuery (), I get > AreaDataSet.ScalarQuery () as my selection, and clicking the Preview > button shows me the data I want to display in my form (the column is > called "Expr1"). > > My problem is that I don't see how to get this data in my form. The > Data Sources window that's shown when my Form's Design View is > displayed doesn't contain the ScalarQuery, or a QueriesTableAdapter. > I'm still a VB neophyte, but I'm chipping away at it. Can somebody > help me out? > > I did that before I generated my query, and the AreaDataSet,
PlaceBindingSource, PlaceTableAdapter, and PlaceBindingNavigator are already available in my Design view. The problem is that I don't know how to go about getting that Expr1 field from my query into anything I can drag onto the form in a design view. Hi,
You will not see the data in design view only the column names. Once you run it the data will show up. Ken ------------------- Show quoteHide quote "spamsickle@gmail.com" wrote: > I did that before I generated my query, and the AreaDataSet, > PlaceBindingSource, PlaceTableAdapter, and PlaceBindingNavigator are > already available in my Design view. The problem is that I don't know > how to go about getting that Expr1 field from my query into anything I > can drag onto the form in a design view. > > There is no column name for Expr1 in the Design View, so I don't know
how to request the data on my form.
Frustrated trying to use "pure" VS.NET to access database properties
ADO.NET Error Detect if Themes are enabled? Export to excel without using office automation VS2003 and VS2005 Side by Side SQLConnection Setting focus File difference algorithm Opposite of Graphics.FromImage Not inheriting members from the base |
|||||||||||||||||||||||