uniqueidentifier

  • Thread starter Thread starter SMG
  • Start date Start date
S

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
 
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
 
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






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
 
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






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
 
Back
Top