Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataset Sort NOT working 1

Status
Not open for further replies.

Utnapishtim

IS-IT--Management
Joined
Jan 29, 2004
Messages
6
Location
US
Okay - I give up. I have two sql tables (Payment and ReturnHeader); ReturnHeader is indexed by ContentLocation, Payment is indexed by RequestedSettlement Date & ContentLocation. I need the resulting dataset to be sequenced by Payment.RequestedSettlementDate.

While the following code executes without error, the dataset remains sequenced by ContentLocation. Note: I've tried this with and without the AddWithKey line that is commented out below. Help!



Dim PaySqlStatement = "Select Payment.*, ReturnHeader.ContentLocation, ReturnHeader.ElectronicPostmark as ElectronicPostmark from ReturnHeader, Payment where ReturnHeader.ContentLocation = Payment.ContentLocation order by Payment.RequestedSettlementDate;"
SelectTable(PaySqlStatement)
.
.
.
SelectTable(PaySqlStatement)

myConnection = New SqlConnection("server=(local)\NetSDK;Trusted_Connection=yes;database=xyz")
PaymentSqlDataAdapter = New SqlDataAdapter(PaySqlStatement, myConnection)
PaymentRowsCommandBuilder = New SqlCommandBuilder(PaymentSqlDataAdapter)
'PaymentSqlDataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
PaymentSqlDataAdapter.Fill(PaymentDataSet, "Payment")

 
Try using

Code:
PaymentDataSet.Tables("Payment").DefaultView.Sort = "<Sort criteria>"

-Kris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top