Click here to Skip to main content
15,914,642 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Boolean strings Pin
Dave Kreskowiak7-Aug-06 14:28
mveDave Kreskowiak7-Aug-06 14:28 
QuestionAlternate Input Device Programming/Setup [modified] Pin
pirateNation7-Aug-06 9:15
pirateNation7-Aug-06 9:15 
AnswerRe: Alternate Input Device Programming/Setup Pin
Dave Kreskowiak7-Aug-06 14:37
mveDave Kreskowiak7-Aug-06 14:37 
GeneralRe: Alternate Input Device Programming/Setup [modified] Pin
DidiKunz8-Aug-06 3:55
DidiKunz8-Aug-06 3:55 
GeneralRe: Alternate Input Device Programming/Setup [modified] Pin
Dave Kreskowiak8-Aug-06 14:16
mveDave Kreskowiak8-Aug-06 14:16 
QuestionHow to close all open MDI children without closing the Parent Pin
newbjohny7-Aug-06 9:02
newbjohny7-Aug-06 9:02 
AnswerRe: How to close all open MDI children without closing the Parent Pin
newbjohny7-Aug-06 9:26
newbjohny7-Aug-06 9:26 
QuestionDatagrid databinding problem Pin
raul.net7-Aug-06 8:12
raul.net7-Aug-06 8:12 
Hello,
i have a Windows Form that displays a DataSet created at run-time whitin an object i derived from DataGrid.

The user can modify datagrid's cells.

When the user clicks on a "Save" button an INSERT SQL query is created by iterating the rows of the associated DataSet.

The problem is that i cannot keep the DataSet updated with user's changes.

I've thought that databinding DataGrid's derived control with his DataSet property could have worked but i'm confused about how to do it.
Any hints?
Do i have to use a CurrencyManager or something like
"Me.DataBindings.Add("SetDati", Me.SetDati.DefaultViewManager, tabName)"?
Why does BindingContext is associated with Form?

Note that i want to use the control in two ways:
1. Create dataset -> Display dataset -> Get user changes -> Save changes to database
2. Load query into dataset -> Display dataset -> Get user changes -> Save changes to database


Here is the control code:

Public Class SQLDB_Viewer
Inherits System.Windows.Forms.DataGrid

Private odbConn As OleDbConnection
Private odbAdapter As OleDbDataAdapter
Private dsSetdati As DataSet
Private tabName As String
Private selCom As String
Private dbPath As String
Private connString As String

ReadOnly Property SetDati() As DataSet
Get
Return dsSetdati
End Get
End Property

Public Sub New(ByVal db_path As String, ByVal selCommand As String, ByVal table_name As String)
MyBase.New()

connString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & db_path
selCom = selCommand
dbPath = db_path
tabName = table_name

odbConn = New OleDbConnection(connString)
odbConn.Open()

odbAdapter = New OleDbDataAdapter(selCom, odbConn)
odbAdapter.TableMappings.Add("Table", tabName)
dsSetdati = New DataSet
odbAdapter.Fill(dsSetdati, tabName)
dsSetdati.Tables(tabName).DefaultView.AllowDelete = False
dsSetdati.Tables(tabName).DefaultView.AllowNew = False
dsSetdati.Tables(tabName).DefaultView.AllowEdit = True
Me.DataSource = Me.SetDati.Tables(tabName).DefaultView
odbConn.Close()
End Sub

...

End Class

Thanks a lot
AnswerRe: Datagrid databinding problem Pin
raul.net9-Aug-06 1:29
raul.net9-Aug-06 1:29 
QuestionAccessing the cache from a Classlibrary Pin
_Zorro_7-Aug-06 7:30
professional_Zorro_7-Aug-06 7:30 
QuestionCross Thread Call Error Pin
BorgPidgeon7-Aug-06 5:43
BorgPidgeon7-Aug-06 5:43 
AnswerRe: Cross Thread Call Error Pin
Steve Pullan7-Aug-06 15:26
Steve Pullan7-Aug-06 15:26 
QuestionCustomise Report Viewer in Reporting Service 2005 Pin
kcsekhar7-Aug-06 5:25
kcsekhar7-Aug-06 5:25 
QuestionA series of points(coordinates)which form a shape [modified] Pin
szevy_suez7-Aug-06 2:54
szevy_suez7-Aug-06 2:54 
AnswerRe: A series of points(coordinates)which form a shape Pin
Dave Kreskowiak7-Aug-06 14:33
mveDave Kreskowiak7-Aug-06 14:33 
GeneralRe: A series of points(coordinates)which form a shape Pin
szevy_suez8-Aug-06 6:21
szevy_suez8-Aug-06 6:21 
GeneralRe: A series of points(coordinates)which form a shape Pin
Dave Kreskowiak8-Aug-06 14:14
mveDave Kreskowiak8-Aug-06 14:14 
QuestionRe: A series of points(coordinates)which form a shape Pin
szevy_suez9-Aug-06 4:23
szevy_suez9-Aug-06 4:23 
AnswerRe: A series of points(coordinates)which form a shape Pin
Dave Kreskowiak9-Aug-06 16:09
mveDave Kreskowiak9-Aug-06 16:09 
QuestionRe: A series of points(coordinates)which form a shape Pin
szevy_suez9-Aug-06 22:17
szevy_suez9-Aug-06 22:17 
AnswerRe: A series of points(coordinates)which form a shape Pin
Dave Kreskowiak10-Aug-06 2:26
mveDave Kreskowiak10-Aug-06 2:26 
QuestionAccessing Window Service from Other Machine ? Pin
Rizwan Bashir7-Aug-06 2:01
Rizwan Bashir7-Aug-06 2:01 
AnswerRe: Accessing Window Service from Other Machine ? Pin
Craster7-Aug-06 3:02
Craster7-Aug-06 3:02 
Questionlistview item add problem [modified] Pin
skhurams7-Aug-06 1:57
skhurams7-Aug-06 1:57 
AnswerRe: listview item add problem Pin
Rizwan Bashir7-Aug-06 2:04
Rizwan Bashir7-Aug-06 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.