Hi Cor
I have created 2 identical DB's one on the SQL2K server the other on
the local Machine sql2k5. Both with a single table and identical fields.
When I create the connection and then the data adapter using the wizard
in both cases. The data adapter to the 2k server creates OK no errors.
The data adapter to the 2k5 server creates with errors. When I look at
bthe properties vb2003 has failed to create the connection and command
text for INSERT UPDATE and DELETE.
I have since copied the relevant properties from the 2k data adapter
and the 2k3 data adapter then functions correctly for UPDATE (I have
not tried the DELETE & INSERT. One step at a time)
For some reason when I create a Data Adapter using VB2003 pro to
SQL2005 Dev Ed the INSERT UPDATE and DELETE are not created.
All code snippets are direct cut and paste.
Code used to Fill and UPDATE
-------------------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Ds20001.Clear()
Me.da2kCustomer.Fill(Me.Ds20001.Customer)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Me.Ds20031.Clear()
Me.da2k3Customer.Fill(Me.Ds20031.Customer)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Me.da2kCustomer.Update(Me.Ds20001.Customer)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
Me.da2k3Customer.Update(Me.Ds20031.Customer)
End Sub
-------------------------------
SELECT Created against SQL2000
---------------------------
SELECT CustomerID, FirstName, MidName, LastName
FROM Customer
-----------------------
SELECT created against SQL 2005
-----------------------
SELECT CustomerID, FirstName, MidName, LastName
FROM Customer
------------------------
Code created against SQL 2000 but not SQL 2005
------------------
DELETE FROM Customer
WHERE (CustomerID = @Original_CustomerID) AND (FirstName =
@Original_FirstName) AND (LastName = @Original_LastName OR
@Original_LastName IS NULL AND LastName IS NULL)
AND (MidName = @Original_MidName OR
@Original_MidName IS NULL AND MidName IS NULL)
-------------------
INSERT INTO Customer
(FirstName, MidName, LastName)
VALUES (@FirstName, @MidName, @LastName);
SELECT CustomerID, FirstName, MidName,
LastName
FROM Customer
WHERE (CustomerID = @@IDENTITY)
-----------------------
UPDATE Customer
SET FirstName = @FirstName, MidName = @MidName, LastName =
@LastName
WHERE (CustomerID = @Original_CustomerID) AND (FirstName =
@Original_FirstName) AND (LastName = @Original_LastName OR
@Original_LastName IS NULL AND LastName IS NULL)
AND (MidName = @Original_MidName OR
@Original_MidName IS NULL AND MidName IS NULL);
SELECT CustomerID, FirstName, MidName,
LastName
FROM Customer
WHERE (CustomerID = @CustomerID)
---------------------------
I hope this makes some sense to someone because it is killing me.
I have also tried this on my laptop running SQLEXPRESS and VB2003 pro
and I get the same errors
Thanks in advance for your time