TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tnita24
NA
2
0
how do i insert data to my sql db?
Oct 18 2004 7:08 AM
hii, can any1 plz help me.. am not able to insert data in my db. Each time an error msg is being displayed .. 'incorrect mapping of table' Am sending u my code plz check it. thx Imports System Imports System.Data Imports System.Data.SqlClient Public Class frmUserDetails Inherits CSLCore.frmBaseForm Dim TotalRows As Long Dim dsStaffData As DataSet = New DataSet Dim bmUser As BindingManagerBase Dim cmdString As String = "Select * from Staff" Dim connString As String = "Data Source=(local);Initial Catalog=SupplyChain;Integrated Security=SSPI;" Dim myConnection As SqlConnection = New SqlConnection(connString) Dim da As SqlDataAdapter = New SqlDataAdapter(cmdString, myConnection) Private Sub frmUserDetails_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Try ' Open connection myConnection.Open() da.Fill(dsStaffData, "Staff") bmUser = Me.BindingContext(dsStaffData, "Staff") BindData() With cboTitle .Items.Add("Miss") .Items.Add("Mr") .Items.Add("Mrs") End With 'DataGrid1.DataSource = dataSet1.DefaultViewManager Catch ae As SqlException MessageBox.Show(ae.Message) End Try End Sub #Region "Add" Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click If cmdAdd.Text = "&Add" Then DisableNavigation() bmUser.EndCurrentEdit() da.Fill(dsStaffData, "Staff") bmUser.AddNew() With txtStaffID '.ReadOnly = False .Focus() End With Else bmUser.CancelCurrentEdit() EnableNavigation() End If End Sub
Reply
Answers (
1
)
Mapping between SqlDbType.double and SQLServer's money?
how to convert access database to SQL Server 2000??