469,283 Members | 2,192 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,283 developers. It's quick & easy.

uniqueidentifier

SMG
Hi all,
I created one table with following structure, and bound the same with a
DataGird.

But I am not able to see any column which is having 'uniqueidentifier' as
datatype.

Name DataType
ID uniqueidentifier
UID uniqueidentifier
CatID uniqueidentifier
CustName Varchar
CustAdd Varchar

A help will be appreciated.

Shailesh
Nov 18 '05 #1
3 2015
On Wed, 18 Aug 2004 18:03:10 +0530, SMG wrote:
Hi all,
I created one table with following structure, and bound the same with a
DataGird.

But I am not able to see any column which is having 'uniqueidentifier' as
datatype.

Name DataType
ID uniqueidentifier
UID uniqueidentifier
CatID uniqueidentifier
CustName Varchar
CustAdd Varchar

A help will be appreciated.

Shailesh


uniqueidentifier is stored as System.Guid in a dataset you should call a
..Tostring method somewhere in your design.

- Oytun YILMAZ
Nov 18 '05 #2
SMG
No it doesn't work...

I created another table with just a single uniqueidentifier field,
Name DataType
ID uniqueidentifier
CustName Varchar
CustAdd Varchar

and in itemdatabound of datagrid i wrote following lines
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
e.Item.Cells[0].Text = e.Item.Cells[0].Text.ToString();
}

It still doesn't show the first column....
// is it the right place to write the code.. and what ever i have written is that OK? or something else also i have to write.

thanks Oytun for prompt reply...
Regards,
Shailesh


"Oytun YILMAZ" <oyilmaz@_REMOVE_veripark.com> wrote in message news:1f******************************@40tude.net.. .
On Wed, 18 Aug 2004 18:03:10 +0530, SMG wrote:
Hi all,
I created one table with following structure, and bound the same with a
DataGird.

But I am not able to see any column which is having 'uniqueidentifier' as
datatype.

Name DataType
ID uniqueidentifier
UID uniqueidentifier
CatID uniqueidentifier
CustName Varchar
CustAdd Varchar

A help will be appreciated.

Shailesh


uniqueidentifier is stored as System.Guid in a dataset you should call a
.Tostring method somewhere in your design.

- Oytun YILMAZ
Nov 18 '05 #3
On Wed, 18 Aug 2004 18:52:44 +0530, SMG wrote:
No it doesn't work...

I created another table with just a single uniqueidentifier field,
Name DataType
ID uniqueidentifier
CustName Varchar
CustAdd Varchar

and in itemdatabound of datagrid i wrote following lines
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
e.Item.Cells[0].Text = e.Item.Cells[0].Text.ToString();
}

It still doesn't show the first column....
// is it the right place to write the code.. and what ever i have written is that OK? or something else also i have to write.

thanks Oytun for prompt reply...
Regards,
Shailesh


"Oytun YILMAZ" <oyilmaz@_REMOVE_veripark.com> wrote in message news:1f******************************@40tude.net.. .
On Wed, 18 Aug 2004 18:03:10 +0530, SMG wrote:
> Hi all,
> I created one table with following structure, and bound the same with a
> DataGird.
>
> But I am not able to see any column which is having 'uniqueidentifier' as
> datatype.
>
> Name DataType
> ID uniqueidentifier
> UID uniqueidentifier
> CatID uniqueidentifier
> CustName Varchar
> CustAdd Varchar
>
> A help will be appreciated.
>
> Shailesh


uniqueidentifier is stored as System.Guid in a dataset you should call a
.Tostring method somewhere in your design.

- Oytun YILMAZ


Hi,

I got it working like this:

Protected Function GetGUIDText(ByVal guid As Guid) As String
Return guid.ToString
End Function

<asp:DataGrid id="DataGrid1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label runat="server" Text='<%# GetGUIDText(DataBinder.Eval(Container,
"DataItem.mYcOLUMN")) %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

- Oytun YILMAZ
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Jacques Wentworth | last post: by
4 posts views Thread by christopher.secord | last post: by
1 post views Thread by Scott M. Lyon | last post: by
1 post views Thread by Scott M. Lyon | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.