ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 10th, 2003, 11:29 AM
topboy31 topboy31 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: somerset uk
Posts: 1 topboy31 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry is ADO .NET mad or is it me being blind

if anyone can see whats wrong with this code they win a prize cos i cant see it..... All i am trying to do is insert a new row in a table. it goes into a dataset ok and displays fine in the grid but when i try to go past that i get an error in the OleDbCommandBuilder.

Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click

Dim conn As New OleDbConnection()
Dim DAFlexi As New OleDbDataAdapter("Select * from LoggedDetails", conn)
Dim DSFlex As New DataSet()



Dpath = "C:\Flexi Time"

'this assigns the connection string
conn.ConnectionString = ConnectToDb()
conn.Open()

'fill the data set with data from the table supplied
DAFlexi.Fill(DSFlex, "LoggedDetails")
DataGrid1.SetDataBinding(DSFlex, "LoggedDetails")

Dim DRFlexi As DataRow = DSFlex.Tables("LoggedDetails").NewRow

DRFlexi.Item("User") = Uname
DRFlexi.Item("StartTime") = TimeOfDay
DRFlexi.Item("FDate") = Today
DRFlexi.Item("MachineName") = CName
'adds a row to the table supplied in the dataset
DSFlex.Tables("LoggedDetails").Rows.Add(DRFlexi)

If DRFlexi.RowState = DataRowState.Added Then
MsgBox("ADDED")
End If

Dim OcommBuild As OleDbCommandBuilder = New OleDbCommandBuilder(DAFlexi)
DAFlexi.Update(DSFlex, "LoggedDetails")

'DataGrid1.Refresh()
conn.Close()
conn = Nothing
End Sub

please give me some guidence

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > is ADO .NET mad or is it me being blind


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT