Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2003, 07:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I looked a datagrid in a windows form, but nothing jumps out at me. I don't work with those so I can't be much help.

In web forms you can specific a format for a column, but I don't know how you would do that on a windows form datagrid.

Sorry I'm not more help.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 20th, 2003, 12:10 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, Here another question:

HOw would one Delete a row from a Datagrid, Setting the focus of the highlighted row and delteing that particular row. I am in Vb.net form, and seem that I need to databind information between the grid and the database?
 
Old November 20th, 2003, 12:51 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This Code is behind a button which loads my Datagrid, from an Access Database. Now I would like to have button which Delete's the Highlight rows in my Datagrid from my Database.

Can anyone please help me????


Private Sub Button3_Click
        Dim NTID As String

        NTID = txtNTID.Text

        Dim Direct As String = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\DATA\ACCESS\13FloorEquipment.mdb"
        Dim strSQL As String = "SELECT [ID], [ItemName], [StartDate],[EndDate],[NTID] FROM(Requests) "
        strSQL = strSQL & "Where(([NTID]='" & NTID & "'));"

        Dim conn As OleDbConnection = New OleDbConnection(Direct)

        Dim Xa As OleDbDataAdapter

        Xa = New OleDbDataAdapter(strSQL, conn)
        Dim Xs As New DataSet()

        Xa.Fill(Xs, "Requests")

        DataGrid1.DataSource = Xs.Tables("Requests").DefaultView


    End Sub
 
Old November 20th, 2003, 06:22 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Users I have found this code, but it seems not to loop though my dataset, and not return all information in row....

Does this jog anyone memory>>>>

Dim iLoop As Integer
        Dim iRow As Integer = 0
        Dim myRow As DataRow
        'Loop through the dataset

        iLoop = Xs.Tables(0).Rows(iRow).Item(0) 'Xs.Tables("Requests").Rows.Count(+1)

        'load row
        myRow = Xs.Tables("Requests").Rows(iRow)
        'get selected row from table Vmake

        iRow = DataGrid1.CurrentCell.RowNumber





Similar Threads
Thread Thread Starter Forum Replies Last Post
Information on CSS Bourke36 CSS Cascading Style Sheets 0 July 19th, 2008 03:59 AM
further information dhoward Crystal Reports 0 February 21st, 2008 03:57 PM
information about iis piyush_patel ASP.NET 1.x and 2.0 Application Design 1 September 28th, 2007 10:59 AM
Information on C# student_help C# 1 December 16th, 2005 07:34 PM
DataGrid Information KennethMungwira ADO.NET 6 September 24th, 2004 10:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.