I have a simple data object that returns two columns in a dataset, ID
and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to
manually enter the column names for the ID and value. How do I make
the schema available? 7 2858
Larry Bud wrote:
I have a simple data object that returns two columns in a dataset, ID
and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to
manually enter the column names for the ID and value. How do I make
the schema available?
I don't quite understand what you mean by
How do I make the schema available?
but if what you want is to avoid having to
enter the column names for the ID and value
I think you have no other option rather than specifying the
DataTextField and DataValueField properties of the DropDownList, because
their default values are string.Empty. The only case you can avoid
specifying them is if your DataSource has only one field as specified in http://msdn2.microsoft.com/en-us/lib...7(VS.80).aspx:
If the data source has only one field, you do not have to explicitly
set these fields, because the control will simply display the single field.
Regards
Poli
Poli García wrote:
Larry Bud wrote:
>I have a simple data object that returns two columns in a dataset, ID and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to manually enter the column names for the ID and value. How do I make the schema available?
I don't quite understand what you mean by
How do I make the schema available?
but if what you want is to avoid having to
enter the column names for the ID and value
I think you have no other option rather than specifying the
DataTextField and DataValueField properties of the DropDownList, because
their default values are string.Empty. The only case you can avoid
specifying them is if your DataSource has only one field as specified in http://msdn2.microsoft.com/en-us/lib...7(VS.80).aspx:
If the data source has only one field, you do not have to explicitly
set these fields, because the control will simply display the single field.
Regards
Poli
The link is: http://msdn2.microsoft.com/en-us/lib...77(VS.80).aspx
On Oct 17, 11:44 am, Poli García <poligar...@gmail.comwrote:
Larry Bud wrote:
I have a simple data object that returns two columns in a dataset, ID
and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to
manually enter the column names for the ID and value. How do I make
the schema available?
I don't quite understand what you mean by
How do I make the schema available?
but if what you want is to avoid having to
enter the column names for the ID and value
I think you have no other option rather than specifying the
DataTextField and DataValueField properties of the DropDownList, because
their default values are string.Empty. The only case you can avoid
specifying them is if your DataSource has only one field as specified inhttp://msdn2.microsoft.com/en-us/library/31723w77(VS.80).aspx:
If the data source has only one field, you do not have to explicitly
set these fields, because the control will simply display the single field.
So anytime I bind any data object, such as a GridView, to a
datasourceobject, I have to manually specify the column names?
Larry Bud wrote:
On Oct 17, 11:44 am, Poli García <poligar...@gmail.comwrote:
>Larry Bud wrote:
>>I have a simple data object that returns two columns in a dataset, ID and DESC, for example. When I bind a dropdownlist to this <dataobjectmethod>, I have to manually enter the column names for the ID and value. How do I make the schema available?
I don't quite understand what you mean by
> How do I make the schema available?
but if what you want is to avoid having to
> enter the column names for the ID and value
I think you have no other option rather than specifying the DataTextField and DataValueField properties of the DropDownList, because their default values are string.Empty. The only case you can avoid specifying them is if your DataSource has only one field as specified inhttp://msdn2.microsoft.com/en-us/library/31723w77(VS.80).aspx: If the data source has only one field, you do not have to explicitly set these fields, because the control will simply display the single field.
So anytime I bind any data object, such as a GridView, to a
datasourceobject, I have to manually specify the column names?
Not at all, what I just said applies to DropDownList and the other
ListControls (ie: ListBox, RadioButtonList, CheckBoxList, DropDownList),
with a GridView you can get the columns automatically resolved if you
set the AutoGenerateColumns property to *true*: http://msdn2.microsoft.com/en-us/lib...tecolumns.aspx
Regards
On 17 Oct, 16:15, Larry Bud <larrybud2...@yahoo.comwrote:
I have a simple data object that returns two columns in a dataset, ID
and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to
manually enter the column names for the ID and value. How do I make
the schema available?
ObjectDataSources do not present database schema information at Design
Time in the same way as SQl or XML sources. The output from code
behind ObjectDatasources cannot be inferred by the designer. Like all
other objects and data that are created in code their output is
entirely unknown to the system until run-time.
HTH
On Oct 17, 2:45 pm, Phil H <goo...@philphall.me.ukwrote:
On 17 Oct, 16:15, Larry Bud <larrybud2...@yahoo.comwrote:
I have a simple data object that returns two columns in a dataset, ID
and DESC, for example.
When I bind a dropdownlist to this <dataobjectmethod>, I have to
manually enter the column names for the ID and value. How do I make
the schema available?
ObjectDataSources do not present database schema information at Design
Time in the same way as SQl or XML sources. The output from code
behind ObjectDatasources cannot be inferred by the designer. Like all
other objects and data that are created in code their output is
entirely unknown to the system until run-time.
Thanks, glad to know I wasn't going nuts. I was hoping there was
some way to define what the columns would be, but I guess not.
On Oct 17, 2:14 pm, Poli García <poligar...@gmail.comwrote:
Larry Bud wrote:
On Oct 17, 11:44 am, Poli García <poligar...@gmail.comwrote:
Larry Bud wrote: I have a simple data object that returns two columns in a dataset, ID and DESC, for example. When I bind a dropdownlist to this <dataobjectmethod>, I have to manually enter the column names for the ID and value. How do I make the schema available?
I don't quite understand what you mean by
How do I make the schema available?
but if what you want is to avoid having to
enter the column names for the ID and value
I think you have no other option rather than specifying the
DataTextField and DataValueField properties of the DropDownList, because
their default values are string.Empty. The only case you can avoid
specifying them is if your DataSource has only one field as specified inhttp://msdn2.microsoft.com/en-us/library/31723w77(VS.80).aspx:
If the data source has only one field, you do not have to explicitly
set these fields, because the control will simply display the single field.
So anytime I bind any data object, such as a GridView, to a
datasourceobject, I have to manually specify the column names?
Not at all, what I just said applies to DropDownList and the other
ListControls (ie: ListBox, RadioButtonList, CheckBoxList, DropDownList),
with a GridView you can get the columns automatically resolved if you
set the AutoGenerateColumns property to *true*:http://msdn2.microsoft.com/en-us/lib...webcontrols.gr...
Sure, but not at design time. If I wanted to create template fields,
I'll have to do so manually. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ole M |
last post by:
I'm having some trouble using the ObjectDataSource in ASP.NET 2.0.
I have a wrapper that contains the static methods for Select and Update. The
Update-method takes the business object as...
|
by: Kjetil Klaussen |
last post by:
Hi,
I’m having some troubles trying to bind my dataset to a GridView control
through an ObjectDataSource control. The binding works fine for regular
columns in my dataset, but I can’t seem...
|
by: Dabbler |
last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the
following error when trying to update (ExecuteNonQuery):
System.Data.SqlClient.SqlException: Procedure or Function...
|
by: Bryce Fischer |
last post by:
I've got a simple (I think) asp.net application.
I've created a DataSet in App_Code/ItemDataSet.xsd. Tested connection,
seemed to work fine.
In my ASPX file, I first dropped an...
|
by: Randy Smith |
last post by:
Hi ALL,
I wonder if anyone has been using n-tier to bind to a GridView control by
using the ObjectDataSource. This is our first OOP web application, and we
have no tables. Right now we are...
|
by: GMartin |
last post by:
I have a pop-up form with a three columned Grid that has checkboxes in
a Template Column in the first/left-most column. (The form is to
allow users to select "Members" of a group, where they check...
|
by: Phillip Ian |
last post by:
Tried this over in CSharp.General and didn't get anything, so I
thought I'd try again here. If there's an AJAX specific group I could
ask this in, please let me know...I did look.
I'm trying to...
|
by: rgparkins |
last post by:
So, I've bitten the bullet and am converting some of my asp.net 1.1
sites to asp.net 2.0, now after many issues I have come to a stop with
the objectdatasource and gridviews and maybe someone can...
|
by: =?Utf-8?B?SmF5IFBvbmR5?= |
last post by:
Based on wether a row is selected in a GridView I need to HIDE the last two
columns of a gridview. I do NOT need to make the cells invisible I want to
hide the entire column.
When I set the...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |