|
it gives me an error that wrong type of arguments.
If you can help me on this ..will paste my code. and the function from oracle.
Thanks..
hemaxi
|
|
|
|
|
hemrk wrote: it gives me an error that wrong type of arguments.
What is the "wrong type of arguments"?
|
|
|
|
|
check the datatype of the arguments which ur passing.
Navin
|
|
|
|
|
Hey
I think som that datatype is the problematic as my stored procedure returns Boolean Datatype.
and cmd.parameters.add ("",Oracledatatype....doesnt have boolean type.
I m using oracleclient . So , Probably it doesnt support Boolean data type.
Below is my stored procedure parameters..
PROCEDURE Add_User_Role
( UserID IN NUMBER
, SoftwareID IN NUMBER
, RoleNo IN NUMBER
, ReturnValue OUT BOOLEAN);
my vb code is like this...
With cmdUserRoleFunc
.Transaction = myTrans
.Connection = cnContract
.CommandType = CommandType.StoredProcedure
.CommandText = "Add_User_Role"
End With
Dim paramReturnValue As New OracleParameter()
paramReturnValue.ParameterName = "@return_value"
paramReturnValue.OracleType = OracleType.Int32 ' here want to use boolean but doesnt have in enumeration.
paramReturnValue.Direction = ParameterDirection.Output
Dim paramUserId As New OracleParameter()
paramUserId.ParameterName = "@UserId"
paramUserId.OracleType = OracleType.Int32
paramUserId.Direction = ParameterDirection.Input
paramUserId.Value = UserId
Dim paramSftwrId As New OracleParameter()
paramSftwrId.ParameterName = "@SoftwareId"
paramSftwrId.OracleType = OracleType.Int32
paramSftwrId.Direction = ParameterDirection.Input
paramSftwrId.Value = 42
Dim paramRoleNo As New OracleParameter()
paramRoleNo.ParameterName = "@RoleNo"
paramRoleNo.OracleType = OracleType.Int32
paramRoleNo.Direction = ParameterDirection.Input
paramRoleNo.Value = RoleNo
'cmdUserRoleFunc.Parameters.Add(paramReturnValue)
cmdUserRoleFunc.Parameters.Add(paramUserId)
cmdUserRoleFunc.Parameters.Add(paramSftwrId)
cmdUserRoleFunc.Parameters.Add(paramRoleNo)
cmdUserRoleFunc.Parameters.Add(paramReturnValue)
cnContract.Open()
cmdUserRoleFunc.ExecuteScalar() 'Gives me error here..that illegal variable
Pls. Help me..i just wanted to get rid of this problem
Thanks anyways,
Hemxi
|
|
|
|
|
Hey
I think som that datatype is the problematic as my stored procedure returns Boolean Datatype.
and cmd.parameters.add ("",Oracledatatype....doesnt have boolean type.
I m using oracleclient . So , Probably it doesnt support Boolean data type.
Below is my stored procedure parameters..
PROCEDURE Add_User_Role
( UserID IN NUMBER
, SoftwareID IN NUMBER
, RoleNo IN NUMBER
, ReturnValue OUT BOOLEAN);
my vb code is like this...
With cmdUserRoleFunc
.Transaction = myTrans
.Connection = cnContract
.CommandType = CommandType.StoredProcedure
.CommandText = "Add_User_Role"
End With
Dim paramReturnValue As New OracleParameter()
paramReturnValue.ParameterName = "@return_value"
paramReturnValue.OracleType = OracleType.Int32 ' here want to use boolean but doesnt have in enumeration.
paramReturnValue.Direction = ParameterDirection.Output
Dim paramUserId As New OracleParameter()
paramUserId.ParameterName = "@UserId"
paramUserId.OracleType = OracleType.Int32
paramUserId.Direction = ParameterDirection.Input
paramUserId.Value = UserId
Dim paramSftwrId As New OracleParameter()
paramSftwrId.ParameterName = "@SoftwareId"
paramSftwrId.OracleType = OracleType.Int32
paramSftwrId.Direction = ParameterDirection.Input
paramSftwrId.Value = 42
Dim paramRoleNo As New OracleParameter()
paramRoleNo.ParameterName = "@RoleNo"
paramRoleNo.OracleType = OracleType.Int32
paramRoleNo.Direction = ParameterDirection.Input
paramRoleNo.Value = RoleNo
'cmdUserRoleFunc.Parameters.Add(paramReturnValue)
cmdUserRoleFunc.Parameters.Add(paramUserId)
cmdUserRoleFunc.Parameters.Add(paramSftwrId)
cmdUserRoleFunc.Parameters.Add(paramRoleNo)
cmdUserRoleFunc.Parameters.Add(paramReturnValue)
cnContract.Open()
cmdUserRoleFunc.ExecuteScalar() 'Gives me error here..that illegal variable
Pls. Help me..i just wanted to get rid of this problem
Thanks anyways,
hemaxi
|
|
|
|
|
HEy
Thanks you all for helping me.
but now its working..i changed returnvalue boolean to integer.
so for sure function and stored proc both are not working when it return type is boolean in vvb.net
Thanks neways
hemaxi
|
|
|
|
|
I've got a web service running, and i'm trying to build tracing in it that gets outputted to a file. Unfortunately, i can't find a way of enabling TRACE token in a VB Website.
I don't want to use the ASP page trace dump, as it will break my SOAP interface.
This code is called on my application start event:
<br />
<br />
Dim lstrFileStream As System.IO.FileStream<br />
Dim objTraceListener As System.Diagnostics.TraceListener<br />
<br />
'Create Stream and Listener<br />
lstrFileStream = New System.IO.FileStream("C:\Temp\Tracer.Log", IO.FileMode.OpenOrCreate)<br />
objTraceListener = New System.Diagnostics.TextWriterTraceListener(lstrFileStream)<br />
objTraceListener.TraceOutputOptions = Diagnostics.TraceOptions.Timestamp<br />
<br />
'Trace Item<br />
System.Diagnostics.Trace.Listeners.Add(objTraceListener)<br />
<br />
This is called at the start of one of the SOAP requests:
<br />
System.Diagnostics.Trace.Write("Add Account Called.")<br />
System.Diagnostics.Trace.Flush()<br />
This generates an empty file, and never writes anything too it.
While i am aware that this style of trace listener may not be ideal, i'd be happy with it writing anything right now.
Any thoughts?
Cheers Chaps
Tris
|
|
|
|
|
I am trying to specify a company name in a var within the app.config file.
Problem: The company name is "Fetch & Co. LCC"
The program balks when it hits the "&" symbol in the string.
Remove the "&" ---- works fine.
This has got to be something simple...
Additional info:
If I try to put the string in the assembly info file (as ProgramTitle) The title will be blank.
Thanks for any help.
|
|
|
|
|
For those who may run into similar problem:
So I kept digging...er googling and finally came up with the correct search term... "illegal characters in app.config"
Solution: The replacement for the illegal character "&" is "& a m p ;" (remove the surrounding quotes and spaces! Ignore HTML and PRE did not work for display purposes).
This works fine.
Thanks to anyone who may have been trying to find an answer to my question.
-- modified at 11:46 Monday 21st August, 2006
|
|
|
|
|
Not come across that particular problem in a config file, but have had similar problem with inserting company names in an Excel worksheet header. Solution was to have two &'s e.g.
"Fetch && Co. LLC"
Steve
|
|
|
|
|
Hi All,
I have written a word Addin in VB and have added a sub-menu under "File" and some menu items under that. I have seen that the menu items added there sometimes appear at undesired places also ex: under AutoText-> Header/Footer menu in word. They also disappear after I delete Normal.Dot and restart the word session. This is not consistently reproducible.
Can anyone tell me what could be going wrong here?
Thanks and Regards,
Anil
|
|
|
|
|
I have developed addin in vb.net
My problem is about Context Menu.
When ever we right-click on the folder-tree-view code gives error that the "Explorer is closed and can not be used further"
what can be possible problem?
I think if i could some how detect the object on which right-click is done i can handle that..
or if i can detect the Pane .. eg. if i right click on Outlookbar then only the context menu appears that will too do..
well one more Q about Preview Pane is HOT TO ADD CONTEXT MENU TO PREVIEW PANE?
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
I am having trouble with my ColorDialog application settings, so that I may close the program, then open it back up to see it has retained its information. Previous help suggested I use the said My.Settings.FontColor, but it's throwing an error, saying that it's not part of Scribble.My.Mysettings. I suggested using strFontColor, but I was told that FontColor was the solution.
Private Sub btnFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFont.Click
'Declare the variables
cdgFont.Color = My.Settings.FontColor
'Show the Color Dialog
If cdgFont.ShowDialog = Windows.Forms.DialogResult.OK Then
'Set the FontColor property of the form
Index.txtFile.ForeColor = cdgFont.Color
My.Settings.FontColor = cdgFont.Color
End If
End Sub
|
|
|
|
|
It is difficult to help you without more info. Where is the error being thrown? How is the FontColor setting defined? (Application settings cannot be altered and persisted at runtime, so you need to make sure it is defined as a User setting).
|
|
|
|
|
Well, I thought I was explaining it the best I could, but I guess I could do better. Well, my startup form Index is the one that needs to be able to load the settings for cdgFont(the Color Dialog control), and The code I tried to use is here:
Private Sub Index_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Prefs.cdgFont.Color = My.Settings.FontColor
Prefs.cdgBackground.Color = My.Settings.Background
Prefs.UpdateCheckState()
End Sub
And that code is not loading it up like it should. Here is the code for my button(in the Prefs form) that is supposed to save the application settings. By the way, all my strings are set to User.
Private Sub btnFont_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFont.Click
'Declare the variables
cdgFont.Color = My.Settings.FontColor
'Show the Color Dialog
If cdgFont.ShowDialog = Windows.Forms.DialogResult.OK Then
'Set the FontColor property of the form
Index.txtFile.ForeColor = cdgFont.Color
My.Settings.FontColor = cdgFont.Color
End If
End Sub
My problem is that the program is NOT saving the information, so when I load up the Index form, the settings that should have been saved, are not, or maybe they are, and they do not load up, please help.
I'm new...
|
|
|
|
|
i try to have an SQL to show the data that is between today date and the specific date which is 2 months b4 the specific date. but i just cant get it write
sql = "select * from SoftContract where BETWEEN [ContractEnd]AND NOW "
i try many way like where [ContractEnd]-NOW =60 , contractend >=now AND now <60 but not really got the result i want
anyone can help?
|
|
|
|
|
If you are looking to return all records between [ContractEnd] and two months before, the WHERE clause should be something like:
WHERE [ContractEnd] BETWEEN DATEADD(MONTH, -2, [ContractEnd]) AND [ContractEnd]
Hope this helps.
|
|
|
|
|
there is error when i use that,
Run-time error
no value given for one or more required parameters
highlight---> Adodc1.Refresh
i wonder y dateadd?
Actually i want to show it in datagrid so there will be many data show if the value is there.
-- modified at 23:43 Sunday 20th August, 2006
|
|
|
|
|
What type of database are you executing this query against? Also, it would be helpful if you could better explain exactly what data you are trying to return and post the entire query you are currently executing.
|
|
|
|
|
i use microsoft access as the database .mdb
I have create a button to run that function to show the result in a data grid in VB
Here the coding::
Private Sub Image3_Click()
MsgBox ("Following are customer contract that going to expire in the next 2 months.")
sql = "select * from SoftContract WHERE [ContractEnd] BETWEEN DATEADD(MONTH, -2, [ContractEnd]) AND [ContractEnd]"
Adodc1.RecordSource = sql
Adodc1.Refresh
DataGrid1.Visible = True
Adodc1.Visible = True
showtotal
End Sub
|
|
|
|
|
The syntax is different in Access. Use "m" instead of MONTH.
---
b { font-weight: normal; }
|
|
|
|
|
i try it but thinks not that error cause if syntax error it will show the msg
|
|
|
|
|
No, there will not be a syntax error, as the syntax is valid.
It will think that MONTH is a parameter that you want to pass to the query, and as you don't pass any parameters to the query, the error message will be that it is missing parameters.
---
b { font-weight: normal; }
|
|
|
|
|
Ok, since you want to return the data where [ContractEnd] is between today's date and two months from today's date, the where clause would be:
WHERE [ContractEnd] BETWEEN NOW AND DATEADD("m", 2, NOW)
I am relying on guffa's post for the Access syntax here, as I haven't used Access in many years. This should return all the records from your table where the [ContractEnd] falls between today's date and two months from today's date.
Hope this helps.
-- modified at 8:08 Monday 21st August, 2006
|
|
|
|
|
yes i got it work.
is with the single quote '
thanks
WHERE [ContractEnd] BETWEEN NOW AND DATEADD('m', 2, NOW)
i was trying to enchance it to let user to search their own specific month but it not really working when i place a varible with it. Is it not allow to put variable inside? Example:
----
Public userin
userin = InputBox("Search data (Month)", "How many month do you want to check before the expire date?")
WHERE [ContractEnd] BETWEEN NOW AND DATEADD('m', userin, NOW)
|
|
|
|