|
Hi all
I'm moving an VB6 app to .NET and i'm faced with the following problem:
Having the following stored procedure in SQL SERVER 2000, that returns a dataset (Read only) AND has an OUTPUT parameter at same time, which of the command methods should i use, since it seems that ExecuteReader (Thats seems to be the only that returns a rowset) doesnt update the OUTPUT parameter.
Im I missing something?, Is there Any work Around?
'==============================================================================
ALTER PROCEDURE spGetResourceText (@frmName varchar(20),@MaxIndex int OUTPUT)
AS
SET NOCOUNT ON
SELECT @MaxIndex = Max(Id) FROM tblResourceText WHERE frmName = @frmName
SELECT * FROM tblResourceText WHERE frmName = @frmName
RETURN
'==============================================================================
Thanks in advance for your time!
Carlos Paiva
|
|
|
|
|
Sorry, I've post in the wrong place.
Repost in ADO.NET messageboard!
Thanks
Carlos Paiva
|
|
|
|
|
Carlos,
I hope you want to receive 2 result sets. So you can use DataSet for executing your SQL procedure. Normally Dataset return result sets as Tables.
So from the above, you will get 2 tables, you can written the code like below and retrieve both the resultsets,
Dim DA As New SqlDataAdapter
Dim DS as new Dataset
DA.SelectCommand = {pass your Command object}
DA.Fill(DS)
dim intMaxIndex as integer
intMaxIndex = DS.Tables(0).Rows(0).Item(0)
For intIndex = 0 To DS.Tables(1).Rows.Count - 1
{within this loop you can get each record/field values by
DS.Tables(1).Rows(intIndex).Item({field name})}
Next
Best Regards,
:-OChandru .
|
|
|
|
|
Hello, I am new to VB and need help on a specific question.
I need to know if there is a find function in VB so that I can terminate a loop. Example, suppose I need to find all tildas (~) in a file from start to finish in MS-Word. I would like to use a find function (if it exist) in my test condition so that the program exits the loop when the last tilda is found. Below is a for loop that I hard coded to repeat so many times but I would prefer doing it a better way. Help is appreciated.
Sub test()
'
' test Macro
' Macro recorded 7/30/2006 by Harold-Wishes
'
Selection.Find.ClearFormatting
For Counter = 1 To 20
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.TypeText Text:="'"
Next
End Sub
-- modified at 7:36 Monday 31st July, 2006
|
|
|
|
|
|
Hello,
Could you clarify?
I would like to remove the code below and have the loop stop when the last tilda is found. Currently I have it set to loop twenty times.
For Counter = 1 To 20
I know there is some boolean function for find, but I'm not getting the syntax correct.
|
|
|
|
|
|
hi friends
please tell me custom control min,max,close button of browser through script
if possible then send code if no then why i am using vb.net script javascript
keep in touch
byee
Regards
Irvendeep
|
|
|
|
|
You can't minimize a window using Javascript.
You can't maximize a window using Javascript. The closest is to set the window size to be the same as the screen size. Off the top of my head, something like: window.moveTo(0,0);window.resizeTo(screen.x, screen.y);
Use window.close(); to close the window.
---
b { font-weight: normal; }
|
|
|
|
|
hi there
i am trying to check the checkbox through program .. can any one please help me .. thanks in advance..
bharath.s
|
|
|
|
|
checkbox1.checked = true
i have used that in my programs, it seems to work
Thanks, Terence
|
|
|
|
|
What do you want to check from the checkbox? You have to make it narrow, so other user can help you with it.
Thanks
|
|
|
|
|
i have a decimal number ina variable i want to convert it into hexa decimal
and i want to assign it into a target varable the problem is my target variable can hold only one byte so i want to to assign this hex number in byte by byte
that is if a=&h0fe2
i want to assign b=&h0f
c=&he2
thank you in advance
|
|
|
|
|
Decimal and hexadecimal are string representation of numbers. Are you really having a string representing the number, or are you just having a plain simple number?
I assume that you don't know what you are talking about , and that you have a 16 bit number, and want to split it into two 8 bit numbers (bytes):
a = &hfe2 ' the number 4066
b = a div 256 ' will contain the number 15, or &hf
c = a and 255 ' will contain the number 242, or &he2
---
b { font-weight: normal; }
|
|
|
|
|
Hi All !!
I am new to VB.NET.
I want to add MaskedTextBox control to form. But it has not been in the list of Components/Windows Form of toolbox. So how to add it in Toolbox??
I would appreciate responses for my query.
Thanks,
Manasi
|
|
|
|
|
it should be under common controls. If i is not....
1) Right click on the header of the section
2) click choose items
3) check maskedtextbox
Thanks, Terence
|
|
|
|
|
Hi !
Nice to receive the reply..
But am sorry, am not getting the "common control" on windows form anywhere...moreover I right-clicked to Components under toolbox, and try to add components, but there is no checkbox for MaskedTExtBox control.
It would be great, if u guide me in details.
Thanks
|
|
|
|
|
|
I have a datagrid that displays a computer's filesystem. As the drive is recursed the directories and files are added to the datagrid. The problem is that when it tries to add a directory named "B's Clip" I get an error
"Missing operand after 's'...."
I tried escaping the quote with another quote
(i.e. "B''s Clip") and a backslash (i.e. "B\'s Clip"). Neither worked.
Any ideas on how I can fix this?
thanks,
-- modified at 22:54 Sunday 30th July, 2006
Luis R. Lebron
|
|
|
|
|
Try converting all drive names to string when doing the iteration, it seems like your method is evaluating the drive name as an expression.
|
|
|
|
|
hi, what is the code for connecting VB.Net with Ms Access.? Anyone could help?? I'm really and very new into these things..
thanx..
|
|
|
|
|
Search this site, or even google and there are tons of examples. If you're 'really new' then perhaps it's too soon to worry about databases, the world is filling with people who can make a pretty form in VB, and will never be programmers.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: the world is filling with people who can make a pretty form in VB, and will never be programmers.
Very true
|
|
|
|
|
I am certainly not going to damper your spirits and tell you not to strive for what you want. Look under the system.data namespace in MSDN library. This is the namespace where you can do all kinds of data manipulations using databases. There is something called an oledb provider. There for it should be system.data.oledb This is the only way you can access the Microsoft access database engine.
You can use something like this
'OleDbConnection object used for connecting to a database
Private _ConnectionObj As New OleDbConnection()
'OleDbCommand object used for executing a command
Private _Command As OleDbCommand
_connectionObj.ConnectionString = [Shared].ConnectionString
_ConnectionObj.Open()
_Command = New OleDbCommand("Select * From Registrants", _ConnectionObj)
Where you see [Shared].ConnectionString, this is the string you should pass in
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Visual Studio Projects\AnnualMeetingRegistration\Database\Registrants.mdb;User Id=admin;Password=;
Normally, you would want to store you connection string in the app.config file, but don't do that right now. Just use the string example I showed you. As you get more experienced, you will find better methodologies of programming.
Then you open the connection object and pass the connection object to the command object. After, you have finished close the connection object. If you decide to use a data reader you will have to close that as well.
Here is an excellent website for connection strings. http://www.connectionstrings.com/[^]
I hope this helps,
Tyquaun
|
|
|
|
|
Can message boxes ( pop up boxes) be used within ASP.net forms?
The info I found visual studio says they are SYSTEM.OBJECTS , I tried inherits SYSTEM.OBJECTS but still get a not declared message
Is this something that can only be used in Windows forms? Is there something similar for ASP or VB classes?
Thanks
|
|
|
|