uniqueidentifier

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
 
O

Oytun YILMAZ

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
 
S

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






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
 
O

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top