ADO.net dataset with 2 datatable store it into 1 stored procedure

Hi,

i have 1 dataset which have 2 dataTable contain;
dataTable 1:
FieldName : firstname lastname jobtitle company mobiletelephone contact_Id
Value: Barns Happy Executive Unigi 32123 0

dataTable2:
Fieldname :address street city zipcode country telephone fax contact_Id
44Dover Dover Sg 12345 Singapore 2331 12313 0
I m trying to put the whole dataset into 1 stored procedure
here's my code
Public Function update(ByVal ds As DataSet) As Boolean
Dim da As New System.Data.SqlClient.SqlDataAdapter()
Try
da.InsertCommand = Insert()
da.Update(ds)
ds.AcceptChanges()
Return True
Catch ex As Exception
Return False
result = ex.ToString
Finally
da.Dispose()
da = Nothing
objConn.Dispose()
objConn = Nothing
GC.Collect()
End Try
End Function
Private Function Insert() As SqlCommand
Dim scInsert As SqlCommand = New SqlCommand("spAddBusinessContact")
scInsert.CommandType = CommandType.StoredProcedure
scInsert.Connection = objConn
With scInsert.Parameters
.Add("@userName", SqlDbType.VarChar).Value = username
.Add("@password", SqlDbType.VarChar).Value = password
.Add("@firstname", SqlDbType.VarChar).SourceColumn = "firstname"
.Add("@LastName", SqlDbType.VarChar).SourceColumn = "lastname"
.Add("@jobTitle", SqlDbType.VarChar).SourceColumn = "jobtitle"
.Add("@company", SqlDbType.VarChar).SourceColumn = "company"
.Add("@mobilephone", SqlDbType.VarChar).SourceColumn = "mobiletelephone"
.Add("@businessAddress", SqlDbType.VarChar).SourceColumn = "address"
.Add("@businessstreet", SqlDbType.VarChar).SourceColumn = "street"
.Add("@businessState", SqlDbType.VarChar).SourceColumn = "state"
.Add("@businesscity", SqlDbType.VarChar).SourceColumn = "city"
.Add("@businesszipCode", SqlDbType.VarChar).SourceColumn = "zipCode"
.Add("@businesscountry", SqlDbType.VarChar).SourceColumn = "Country"
.Add("@businesstelephone", SqlDbType.VarChar).SourceColumn = "telephone"
.Add("@businessfax", SqlDbType.VarChar).SourceColumn = "fax"

End With
Return scInsert
End Function

and my error message is:"System.InvalidOperationException: Update unable to find TableMapping['Table'] or DataTable 'Table'.
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
at outlookApps.DA.Contact.update(DataSet ds) in C:\Inetpub\wwwroot\outlookApps\Component\DA\DA.vb:line 89" String
Please let me know what is the problems...The dataset was auto generated and it created 2 datatable automatically when i pass in my XML code.
0
wongz
2/5/2004 8:48:31 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

0 Replies
872 Views

Similar Articles

[PageSpeed] 23

Reply:

Similar Artilces:

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Where is the ADO.NET Sybase driver for .NET 1.1 and .Net 2.0?
Hi All Does anyone know where I can get the Sybase drivers for ADO.NET for both versions, 1.1 and 2.0/3.0? Cheers Chris Burrell Hi Chris, There is no release of ASE ADO.NET Provider 2.0 (I assume you refer to ASE provider, not ASA - if ASA please port to sybase.public.sqlanywhere.general). For the 1.1 Provider: It is available in the ASE SDK for windows or the PC Client CDRom included with ASE product. On the SDK its available as 12.5.1 and 15.0 On ASE PC Client I think 12.5.1 is part of ASE 12.5.X and 15.0 is part of ASE 15.X 2.0 provider should release som...

Can somebody help
I Seem to be going nuts ! I know it has to be simple but I am missing the link. I haven't used crystal reports with asp.net before. So pardom me if my problem sounds silly. My requirement is very simple actually. I am using asp.net 1.1 with vb.net in vs.net 2003 with the inbuilt crystal reports control. I have to connect to a sql server 2000 database to extract rows from a stored procedure which accepts a parameter and the report has to be in Mail label format. I referred various books and web sites and according to that , added a crystal reports file to the project and selected the store...

Using ADO.NET Execute Second Stored Procedure Depending of Output of First Stored Procedure
When a user logs onto the app, I capture their UserId, today's date and thier WINNT using ADO.NET calling a stored procedue-no problem. Now, once the above mention fields have been populated, when the same user logs on again and this time click their daily attendance time, I need to execute and update stored procedure-no problem. Each time the user logs onto the attendance page, they need to be able to view the previuos time stamps, on page load.- no problem The problem is that I cannot get all three to work in concert, although they will work independently, somewhat. Sotred proc...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

How to Retrive the store procedure return value in Ado.Net by using Dot Net?
Hi i am thiru. i try to create the small search engine. so that i have wrote the store procedure for it. thats given below.Create procedure FindtestThree @Name varchar(25), @Location varchar(25), @EmpId varchar(25) as select * from TbInfo where Name like + '%' + @Name + '%' select * from TbInfo where Location like + '%' + @Location + '%' select * from hi where ComName like + '%' + @EmpId + '%' Exec FindtestThree 'aa','a','d' ----------------------------------------- The above procedure return t...

ADO.NET, GUID and ASA 8.0.2.4392 Stored Procedure...
Hello All, I am having issues... I have two tables The First is Category. Category Has Two Fields Category_ID type uniqueidentifier and Name type varchar(30) The second table is Value. It has three fields Value_ID type uniqueidentifier, Category_ID type uniqueidentifier and Name type varchar(30) I am connecting to the first table using ASADataReader with a simple select * from category. (there is only one record). I am filling a variable named _id type GUID with dr["Category_ID"]. The variable is populated and life to this point is good. Here is the st...

what are the dataset features of 2.0 as compared with ado.net 1.1 & 1.0
 Hi,What are the dataset features of ado.net 2.0 as compared with ado.net 1.1 & 1.0.I need in-depth knowledgeplease give perfect solution. Friend, here are the new features of the Dataset in the 2.0 http://www.c-sharpcorner.com/UploadFile/amit_agrl/DataSetFeature.doc08222005024247AM/DataSetFeature.doc.aspx http://www.15seconds.com/issue/050302.htm   Good luck!Please Don't forget to click "Mark as Answer" on the post that helped you.This can be beneficial to other community members reading the thread. sankar.nvss :What are the dataset features of ado.net ...

ADO.NET 2.0 - Three-tier application - connection string error
Using ASP.NET 2.0 beta, VS2005 beta 1, W2k3 server with IIS I try to build a three-tier app structure as followed: - the store procedure in SQL with a input parameter as Username and retrieve the UserId as output parameter. - the business logic (class) with connection string defined in web.config (“AppConnectionStringASPNETapp”) - the presentation aspx file after the user has logged in through login.aspx I have work out 2 scenarios with 2 different errors. Scenario 1: Here is the code is business logic (class) (catalog.cs) using System; using System.Data; usi...

Stored procedures and ADO.NET
CREATE procedure sp_UserLogin  @UserName varchar(15), @Pwd varchar(15), @LastLogin DateTime AS  Declare @var_result bit out  set @var_result='0'   if (Select UserName from dbo.tblLoginDetails where UserName=@UserName and Pwd= @pwd) != NULL Begin  set @var_result='1' End   if @var_result='1'  Begin  update dbo.tblLoginDetails   set LastLogin =@LastLogin where UserName=@UserName    return @var_result EndGO So I have to use it in my C# code so that I get a 1 or 0 t...

Writing Stored Procedure in .NET 1.1 and using in SQL Server 2005
Hi, I am working on an application in ASP.NET 1.1 and SQL Server 2005 as database.I wanted to use SQLCLR feature of SQL Server 2005. Is it possible that i write Stored Procedures in C# 1.1 and deploy on SQL Server 2005? as it is in case of C# 2.0. Please refer some good tutorial for it. Regards,Imran GhaniImran Abdul Ghani SQL Server requires 2.0. The .net team made a number of changes to the memory manager and gc so .net could be hosted in SQL Server....

ADO.NET Nested Stored Procedures
Hello, I have a stored procedure that executes a stored procedure on another server. I can run both of them fine from a query screen. However whenever I try and execute the stored procedure from within my code I always get a Incorrect syntax near 'stored_procedure_name'. error. Does ADO.NET allow nested stored procedures? mtia Time has passed since I asked this question, so to answer my question it is Yes.  My problem was a permissions issue, too early in the morning and not enough coffee  :p skin256:My problem was a permissions issue, too early in the morning and...

DataSet from Stored Procedure in VS.NET
Hi, I want to fill a DataSet from a stored procedure.  If you do a search on this forum this has been asked several times. The code has been given, but I don't want to just paste the code in, I want to drag the connection, command and adapter to the web form, then add what is left of the code.  I must be getting it out of sequence, I can't get it to work. Can someone give me the correct steps? I'm using VS.NET 2003, using vb.net for my ASP.net site. Thanks, Steve is it necessary for you to drag the items over? you can simply drag a dataadapter over and then go th...

ADO.NET and Stored Procedure Question
I have a Stored Procedure: ALTER PROCEDURE dbo.GetHostID@pHN varchar(50) AS SELECT HostNameID FROM Hostname WHERE (Host = @pHN) RETURN In my application code all I'm trying to do is get the value in the column "HostNameID" so that I can assign the int value to a label.  The user enters the Host in a textbox and I use that to get correct row.   private void GetHostnameRecord(string host)    {        try        {          ...

Web resources about - ADO.net dataset with 2 datatable store it into 1 stored procedure - asp.net.getting-started

Stack Overflow
Stack Exchange log in - careers - chat - meta - about - faq Questions Tags Users Badges Unanswered Ask Question Top Questions interesting 325 ...

University of Southampton - Wikipedia, the free encyclopedia
The University of Southampton is a British Russell Group university located in the city of Southampton , United Kingdom . The origins of the ...

London Metropolitan University - Wikipedia, the free encyclopedia
London Metropolitan University (London Met), located in London , England , was formed on 1 August 2002 by the amalgamation of the University ...

Google Chart Tools — Google Developers
This page has moved to Google Developers. Welcome! Learn more Dismiss Home Products Events Showcase Google Chart Tools Overview Hello Charts! ...

Google Chart Tools — Google Developers
Powerful, simple to use, and free.

AribaWeb (aribaweb.org) - Google Groups
Search Images Maps Play YouTube News Gmail Documents More Calendar Translate Mobile Books Offers Wallet Shopping Blogger Reader Finance Photos ...

Linux Syscall Reference
Generated from Linux kernel 2.6.35.4 using Exuberant Ctags , Python , and DataTables . Developed and maintained by Greg Ose .

NewsMap
... over one weekend where the author had a bit of extra time on his hands. Built with the help of the following tools: Bootstrap jVectorMap DataTables ...

A Map for the Microsoft Application Development Platform
... Localization N-Tier Remote Data Security Silverlight SQL Azure SQL Server Streaming XML Features ADO.NET DataSet ADO.NET DataTable ...

Application Development Framework
Articles: Application Development Framework

Resources last updated: 1/10/2016 1:54:01 AM