473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Anger, Rage, Confusion...

Roy
Ok... Got a master/detail datagrid page with a main datagrid and a
nested one. The nested one I have contained within a user control. It's
editable. All is well. However, I noticed that the query that pulled
the data to the nested grid took some time. "No problemo, I'll just
turn it into a stored procedure," I said. Which I did... only now it
doesn't work! There are no errors, the nested grid just doesn't display
any data (as if the SP results aren't reaching the datagrid). I'm
clueless. What gives? Anyone?

Here's the bind grid function for the nested grid.

*****************************
Sub Bind_FVD_Grid()
FVDConnection = New
SqlConnection("server=localhost;uid=;pwd=;database =test")
Dim FVDCommand As SqlCommand = New SqlCommand ("Get_FVD_Data",
FVDConnection)
Dim FVDAdapter As SqlDataAdapter
Dim DS As New DataSet()

With FVDCommand
..CommandType = CommandType.StoredProcedure
..Parameters.Add (New SqlParameter("@x", SqlDbType.nvarchar)).Value = x
..Parameters.Add (New SqlParameter("@y", SqlDbType.nvarchar)).Value = y
End With

FVDAdapter = New SqlDataAdapter(FVDCommand)
FVDAdapter.Fill(DS,"Results")
FVD_Grid.DataSource = DS.Tables("Results")
FVD_Grid.DataBind()
End Sub

Nov 19 '05 #1
3 915
Roy
Hrmm.... Could it have something to do with my x and y variables being
declared in the vb code as strings yet the parameters are declared as
nvarchar?

I know for a fact that the x and y variables have the correct values,
but if they weren't reaching the stored proc somehow that could explain
the blank datagrid...

Thoughts, anyone?

Nov 19 '05 #2
Hey Roy,
Hrmm.... Could it have something to do with my x and y variables being
declared in the vb code as strings yet the parameters are declared as
nvarchar?
You can use an overload of the SqlParameter constructor that takes also the size
of the field and the source column, eg New SqlParameter("@x",
SqlDbType.nvarchar, 50, "sourcecolumn"). That would solve that.
I know for a fact that the x and y variables have the correct values,
but if they weren't reaching the stored proc somehow that could explain
the blank datagrid...


Silly question, but I have to ask: are you sure that the sproc is returning
exactly the data you want? Have you run it in query analyzer at *all*?

--
Software is like sex: it's better when it's free -- [Linus Torvalds]

Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
To reply: news [at] mamakin1976 [dot] plus [dot] com
Nov 19 '05 #3
Roy
Yep, I've tried it. The sql code works and returns values in QA.
It's just that when run, the nested grid only returns the column
headers with no data.
*sigh*

Thanks for the overload tip, I'll give that a try tomorrow.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug Farrell | last post by:
Hi all, I'm trying to do the following from within a code module: import re # text to match text = "Good morning x something /x, how are you today x something else /x"
1
by: Mathias Mamsch | last post by:
Hi, I have some confusion concerning the weakref module. I am trying to save a weak reference to a bound member function of a class instance for using it as a callback function. But I always...
38
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages...
10
by: Kamilche | last post by:
I'm trying to pack two characters into a single byte, and the shifting in Python has me confused. Essentially, it should be possible to use a 'packed string' format in Python, where as long as...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
0
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
2
by: Riaaaa | last post by:
Hello, We are doing the project in VB.Net. We had a great confusion for ASP.Net and VB.Net. Is VB.Net project performed in Microsoft Visual Studio 2005 ?? We have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.