Thanks for your reply.
""Jeffrey Tan[MSFT]"" <v-jetan@online.microsoft.com> wrote in message
news:LARPvjoiEHA.3936@cpmsftngxa10.phx.gbl...
> Hi David,
>
> Based on my understanding, you can not updating bool column in dataset
> through DataGrid.
>
> I have writen a sample project, which retrieve the datatable through a
> sample table in Sql Server's pubs database. This table contains a column
> "bool" which can be updated well in datagrid:
> private void button1_Click(object sender, System.EventArgs e)
> {
> for(int i=0;i<ds.Tables[0].Rows.Count;i++)
> {
> Console.WriteLine(ds.Tables[0].Rows[i]["bool"].ToString());
> }
> }
>
> DataSet ds=null;
> private void Form1_Load(object sender, System.EventArgs e)
> {
> SqlDataAdapter adapter=new SqlDataAdapter("select * from b",
> "server=localhost;database=pubs;uid=sa;pwd=test");
> ds=new DataSet();
> adapter.Fill(ds);
> this.dataGrid1.DataSource=ds.Tables[0];
> }
>
> The table's sql script is:
> if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[b]')
> and OBJECTPROPERTY(id, N'IsUserTable') = 1)
> drop table [dbo].[b]
> GO
>
> CREATE TABLE [dbo].[b] (
> [id] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
> [bool] [bit] NULL
> ) ON [PRIMARY]
> GO
>
> If I misunderstand you, please feel free to tell me.
> ==========================================
> Please apply my suggestion above and let me know if it helps resolve your
> problem.
>
> Thank you for your patience and cooperation. If you have any questions or
> concerns, please feel free to post it in the group. I am standing by to be
> of assistance.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! -
www.microsoft.com/security > This posting is provided "as is" with no warranties and confers no rights.
>