Hi, I have a multiple resultset returned by the stored procedure (4 select statements returning different values). When I call SqlCommand's ExecuteReader on the following piece of code: cn = new System.Data.SqlClient.SqlConnection(ConnectionString); cn.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = cn; cmd.CommandText = "spResSupervisorSwitchboard"; cmd.CommandType = CommandType.StoredProcedure; SqlDataReader rdr = cmd.ExecuteReader(); while(rdr.Read()) { lblWaitingFirstEntry.Text = rdr[0].ToString(); // System.InvalidOperationException } rdr.NextResult();
The connection is opened fine, the stored procedure name is correct, stored procedure returns values when executed in SQL Query Analyzer... but it doesn't work in my code. :mad: Cheers
Husein
Posts
-
SqlDataReader fails with multiple resultsets -
Tab Order optionThere is a TabIndex, but not Tab Order option on the Edit menu, like in Windows Forms. You click that and then you get a lot of little boxes with numbers identifying current tab order and you click on them to change the tab order. ;)
-
Tab Order optionWhy didn't they implement Tab Order in ASP.NET pages? It does a great job in Windows Forms.
-
Provide User With Form and Caption edit optionTahir, Check this site http://www.windowsforms.net/default.aspx?tabindex=5&tabid=47&ItemID=13&mid=142[^]
-
ParsersI am interested in creating parsers, but I cannot find anywhere a decent site or book that explains this. I have found some info about top-down and bottom-up parsers, but I would like more details, differences and a good tutorial. Any help would be highly appreciated. Thanks a lot.
-
Stored procedure questionCREATE PROCEDURE MyProcedure AS SELECT * FROM SomeTable I hope this helps. Functions are slightly different. There are three types of functions, those that return scalar value, inline table-valued functions and multi-statement table-valued function. The one that you might want is inline table-valued function CREATE FUNCTION MyFunc RETURNS TABLE AS RETURN (SELECT * FROM SomeTable WHERE SomeColumn = SomeCriteria)
-
It was bound to happen :)... and was 3rd party "software/hardware" involved? :-O
-
It was bound to happen :)He forgot to append build and revision numbers :doh:
-
Almost 300,000 messages postedLook on a bright side. Maybe there will be something that is of a lot of interest to you. :-O
-
DSF Satellite ChannelOne thing that really annoys me while watching DSF's Laola or any other sports program after 22:00 is that in the middle of the goals from football (soccer) matches they give you those stupid erotic adverts with some anoying old ladies. And that lasts for 15 minutes. And that seems to be the case with other German channels.:mad:
-
Morality & EthicsBe like Japanese tourists in London. Carry 23 cameras around your neck and have both colour and B&W ready. :)
-
Fact or Fiction?Encarta explanation of the word F***[^] and read the last part about the origins. Apparently it is scandinavian. (OK, now you don't need to read the last part. :cool: )
-
I'm desperate, help! [edit]Now imagine how the guys at the European NASA feel when their Beagle thingy-vehicle disappeared. That's what happens when you load WinXP on a Mars vehicle :rolleyes:. And you whine about regsvr-ing two files and not being able to open HTML files. Jörgen, Jörgen ;)
-
Almost 300,000 messages postedHey, this is close to the Total of 300,000. So 1,160 before we hit the round figure.
-
Does she love you....In my country there is a saying "never run after a woman or a bus. There is always another one coming." And this really works. :-D
-
I'm desperate, help! [edit]This happens after installing MDAC?!?!? Great. Viva Microsoft. I am thinking of setting up my own Department of Homeland Security and I will raise the level to Orange or Red whenever Microsoft releases an update. :suss:
-
Scariest computing moment?I was around 8-9 years old and I already had Commodore 64 for some 3 years. Now C64 had this massive transformer (or whatever it was) which had one cable coming out and plugging it into the C64 and the other going into the wall. For three years I would grab it by the wires and lift the transformer. One day before going to school (I was banned on playing on it due to my bad marks in the school) I played a bit and to disassemble it and put it away I lifted the transformer by the wires. To my surprise (well not really surprise, the bang startled me and I pissed myself) There was a huge explosion in the transformer and the electricity in the flat went down. The first ten minutes I was cool (but pissed), trying to be smart and to fix the problem. When it got to the point that I would be late for school and still unable to fix the problem I started crying. So I called my mum as she worked closer to the flat than dad. She came home, kicked a crap out me and sent me to school. Later that day (winter time, late, already dark), on my way back I first checked if there were lights in the flat. There were, so the problem was solved. Mum almost gave me additional kicking, but dad said, it's ok, it were only the fuses. Transformer was fixed, C64 was sold. :(( 15 years later I have 5 PC's in the flat, bought with my money. HE HE HE HE HE HE
-
MS-DOS Commands under WinXPYes, but we learnt things the hard way and we can say that we are the SAS or Navy SEALs of computing. :cool: Take, for example, these kids today. :sigh: I can bet 80% of them don't know what 3 1/2" floppy disk looks like, and lets not mention 5 1/4" ones. Can anyone remember the beauty of running pkzip.exe and pkunzip.exe at the command prompt? Damn, this nostalgia is going to kill me. :-D But one thing I would like to hear again is Wolf3D sound through PC Speaker.;)
-
MS-DOS Commands under WinXPActually I used to have IBM XT. That was quite an experience. It took decades to count that massive amount of memory... 640K ;P. And that sharp picture on a monochromatic monitor. Two colors: black and orange. At that time I didn't realise that there will be a huge hype about it's 20 years so I opened it and disassembled it. It was for educational purposes. After that I through it in a bin. :((
-
So true that it hurts- Honey, I have to tell you a terrible thing. The company went bankrupt. My father dropped me from his last will and took the car away. Will you still love me? - Of course honey, but I will really miss you.