Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / December 2006



Tip: Looking for answers? Try searching our database.

SqlDataAdapter and timeout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 15 Dec 2006 02:05 GMT
OK, I'm confused. The below code works fine until I select a
supplierperson that returns a large number of rows.  Why does the
MsgBox("HERE") display when in fact the sqlDataAdapter has not
returned the data? I can see a horizontal scroll bar on the
datagridview that I am using, but no data ever appears. What can I do
to let the user know that nothing is happening?

Private ds As DataSet

Dim sqlCN As New SqlClient.SqlConnection
Dim sqlCMD As New SqlClient.SqlCommand
Dim intNumRows As Integer = 0

...connection Stuff goes here (which works fine)
...NOTE: I have taken alot of proprietary stuff out of the
sqlCMD.commandText, but it does work.

sqlCMD.CommandText = "select s.supplierperson,p.personid "
"FROM PRODUCT p WITH (NOLOCK) " & _
"LEFT OUTER JOIN supplier s on s.supplierpersonsid =
sp.supplierpersonsid " &_ "WHERE  s.supplierperson LIKE " & "'" &
Me.txtFind.Text & "%'"

Dim da As New SqlDataAdapter(sqlCMD)

Try
    ds = New DataSet
               da.Fill(ds, "Product")
Catch ex As Exception
           MsgBox(ex.Message)
End Try

intNumRows = ds.Tables(0).Rows.Count
MsgBox("HERE")

If intNumRows > 0 Then
        SetupGridSupplierPerson()
End If
Douglas J. Steele - 15 Dec 2006 11:12 GMT
This newsgroup is for questions involving VB6 or older.

You might try posting this to a newsgroup that deals with .Net: they all
include "dotnet" in their name.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> OK, I'm confused. The below code works fine until I select a
> supplierperson that returns a large number of rows.  Why does the
[quoted text clipped - 34 lines]
>         SetupGridSupplierPerson()
> End If
Bob - 17 Dec 2006 01:58 GMT
And there's a Given: Post into the wrong Usenet group, and you will
get an immediate response.

>This newsgroup is for questions involving VB6 or older.
>
>You might try posting this to a newsgroup that deals with .Net: they all
>include "dotnet" in their name.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.