[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Crap solution - ODBC Datagrid column names hyperlinks

(The Fantom)

5/22/2002 3:37:00 PM

Why on earth has Microsoft released such poor ODBC.net reference. It
should at very least work in the same way as the ole db connections
for db connections and data adaptor. I can't even create a dataset
using the gererate dataset method.

Any way ....

I can't change the column names from datagrid and I can't add
hyperlinks on the columns via code can someone help me. I'm using a
sysbase sql anywhere version 5.0 database.

Any sample code please !!!


The wizards don't exist in the odbc reference.
2 Answers

(Hussein Abuthuraya(MSFT))

5/25/2002 1:09:00 AM

0

Bob Beauchemin

5/27/2002 6:16:00 PM

0

The OdbcDataAdapter contains a TableMappings member. TableMappings contains
a ColumnMappings collection for each DataTable. You can use these to map
database column names to DataSet column names before calling fill.

Also, because the DataSet is just a series of collection classes + logic,
you can rename Tables and Columns at will at any time, including after
calling Fill. If you are going to use the DataSet to write back to the
database, Table and ColumnMappings are better.

Hope this helps,
Bob Beauchemin
bobb@develop.com


"The Fantom" <the.fantom@wheelweb.com> wrote in message
news:f71d0070.0205270013.416e86b6@posting.google.com...
> I undersatnd the concept of datasets, The problem (with webforms) is
> that I can't change the datagrid with column names of my choice
> through code, It just wants to use the column names from the database
> table.
>
> SAMPLE - This is connecting to sysbase sql anywhere 5.0
> ------
>
> Dim strsql As String = "SELECT col1,col2 from table"
>
> Dim strConnection As String = "DSN=dsn_name ....
>
> Dim objDataSet As New DataSet()
> Dim objConnection As New
> Microsoft.Data.Odbc.OdbcConnectionstrConnection)
> Dim objDataAdaptor As New
> Microsoft.Data.Odbc.OdbcDataAdapter(strSql, objConnection)
> objDataAdaptor.Fill(objDataSet, "TABLEname")
> Dim objDataView As New
> DataView(objDataSet.Tables("TABLEname"))
> DataGrid1.DataSource = objDataView
> DataGrid1.DataBind()
>
>
> HussAbOnline@microsoft.com (Hussein Abuthuraya(MSFT)) wrote in message
news:<Qem8Kg3ACHA.1340@cpmsftngxa07>...
> > The Odbc.NET data provider is not integrated with any of the Wizards (or
RAD tools) in VS.NET. The OleDb and SqlClient .NET Data Providers are the
only integrated .NET
> > providers that work with RAD tools and wizards.
> >
> > The second part of the question about the DataGrid, not sure which one
you are talking about, WebForms DataGrid or WinForms Datagrid?
> >
> > Side note:
> > Setting the DataGrid has nothing to do with the source of data (SQL
Server, Access or Sybase) because the DataSet is generic container that is
not aware of its datasource.
> > Once it's filled successfully, it retains the data.
> >
> >
> > Thanks,
> > Hussein Abuthuraya
> > Microsoft Developer Support
> >
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> > Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
> > http://www.microsoft.co....
> >
> > --