| "Comparison to integral constant is useless; the constant is outside the range of type 'int'" |
|
 |
Index ‹ DotNet ‹ Visual C#.Net
|
- Previous
- 1
- ADO >> Problems with return parameter from Oracle functionI have an oracle function that looks like this:
AuthenticateUser(UserName IN VARCHAR2, pPassword IN VARCHAR2, AppName IN
VARCHAR2) RETURN VARCHAR2
Using the Oracle client provider, I'm setting up my command text as:
:results = call AuthenticateUser(:username, :password, :appname)
I then add parameters as follows:
OracleParameter p = new OracleParameter("results", OracleType.VarChar);
p.Direction = System.Data.ParameterDirection.ReturnValue;
p.Size = 255
xcmd.Parameters.Add(p);
xcmd.CommandText = _authenticateCall;
xcmd.Parameters.Add(new OracleParameter("username",
OracleType.VarChar)).Value = "abc";
xcmd.Parameters.Add(new OracleParameter("password",
OracleType.VarChar)).Value = "123";
xcmd.Parameters.Add(new OracleParameter("application",
OracleType.VarChar)).Value = "Test";
However, when I execute the command, I get an ORA-01036: illegal
variable name/number exception.
If I leave out the :results paramater from both the command text and
don't add it to the parameters of the command, then I can call the
function w/o the exception. So it seems like .Net can't figure out how
to bind my parameters correctly (this is more or less confirmed by the
stacktrace of the exception).
In every example I've seen, this is the recommended way of calling a
function. What am I missing that would make it bind the return parameter
correctly?
- 2
- Winforms >> VB6 Form Upgrade to .Net ErrorI am upgrading a VB6 application to VB.NET. In the VB6 application I have a
form with a sub called ShowScreen that takes arguements. This has always
worked with no problem/ When I try to upgrade I get the Buil error
"'ShowScreen' is not a member of 'System.Windows.Forms.Form'".
How do I resolve this issue? This might be related to the issue for some of
my Sheridan controls "losing" some of their properties and methods.
Thanks,
Kirk
- 3
- Dotnet >> icon for desktop shortcut not workingHi all,
I am attempting to deploy a vb.net application. That is working fine.
I also configured the installer so shortcuts for the application
would appear on the desktop and the user program menu. That's working
too. What isn't working is the icon that I am setting for these
shortcuts. The icon is a .ico file that works fine for the program
itself, and for any shortcuts that I manually create. After I created
the shortcuts of the primary output in the file system editor, I set
the icon property to my .ico file. However but the shortcut s that
result from installation still show your basic, generic "file" icon.
Anybody have any idea why the icon isn't appearing on the shortcuts
created by installer? I followed the .net help file instructions
exactly!
thanks,
Mike Cooper
- 4
- 5
- Microsoft Project >> How to extract the total number of work days in a month?I am creating a report using Reporting Services. The report should contain a
list of employees and the amount of work done during a month (Actual work)
for each employee as well as the total number of work days in the month. As
all information should be extracted from Project Server database, I need to
create stored procedures to do so. All managers of the company use Project
Professional to access Project Server database.
So far I have not had any problems with the list of employees and actual
work done during a month. But I encountered a problem with extracting the
total number of work days in a month. Obviously, to calculate it, I need to
subtract the number of non-work days from the total number of days in a
month. Project Professional displays such information in the Calendar, which
means that the data can be extracted from the Project Server database, but I
can not find where the data is stored and how it can be consolidated. I have
already examined the docs carefully and tried to identify the query with SQL
Profiler, but without success.
Could you please help me to extract the total number of work days in a
month?
- 6
- Microsoft Project >> SQL to MppHi guys/gals,
I have been administrator for MS Project 2000 for a while
now. It has always been the case that our projects are
stored in a SQL database.
We have a complicated structure with actual projects,
consolidated master projects on several levels, milestone
projects (where all actual projects are linked upto)
We suddenly have to extract actual & milestone projects to
mpp files so that it can be viewed by an outside source.
Lets just say that just by attempting to do this, has run
into major problems. I would compare it to medevil heart
surgery!!! ripping someones heart out, and shoving it into
an open chest and expecting it to work!!!!
Is there a reliable proceedure of how to do this???
Thanks in adv
Robert
- 7
- 8
- Microsoft Project >> Project should provide "print across then down" like ExcelIs there a way to "print across then down" in MS Project like you can do with
Excel? I'm printing my Gantt chart 2 pages wide by 5 pages high, and it's
annoying that the bars that go with page 1 are on page 6.
----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.
http://www.microsoft.com/office/community/en-us/default.mspx?mid=941d70e0-2117-47fa-a491-1ff5a3154e4d&dg=microsoft.public.project
- 9
- Microsoft Project >> Project 2007 Not Enough Memory to PrintOur schedule won't print more than once at a time. If we do a print preview,
it won't print at all. The message, "There is not enough memory to complete
the operation. To free up available memory, close programs, projects, or
windows you aren't using, and then try again." I can close all but Project,
and it still won't print. The only thing that works is to close Project,
reopen it, then open the project without previewing it. It prints fine, but
cross your fingers. If it is two pages wide, you won't know until you waste
a ream of paper.
- 10
- Visual C#.Net >> Modify IIS Folder PermissionI need to change Directory Security permission on folders under the IIS
default web site tree:
Internet Information Services
- Machine Name
- Web Sites
-Default Web Site
+testfolder
Specifically: on the the Directory Securty Tab (right click on a folder
under the Default Web Site) click the edit button next to Anonymous access
and authentication control, uncheck Anonymous access, check Basic
authenticatoin and enter Domain and password...and finally uncheck Integrated
Windows authentication.
I may have chosen the wrong class "IIsWebFileSetting" to change the
properties described above...which also could have added to the confusion.
I am using windows server 2000, with IIS 5.0
I know in the end we are really just changing/entering data in the IIS
metabase, right?
Thank you so much for taking the time to help....I'm really stuck on this one.
Mark
- 11
- Visual C#.Net >> IsAccountLocked and LDAPI think IsAcountBlocked does not work with Active Directory if the conection is an LDAP:// configuration. Am I right? Does someoe have an example with WinNT://
Thanks
Jason
- 12
- Microsoft Project >> Lot production schedule which identifies the Numbers of Lots Released over time?Hi,
I'm working on an Urban Development Program in MS Project 2000. Basically
we are Civil Engineers who design subdivisions of large landholdings for
developers. We subdivide the land into smaller lots in stages. Each stage
has a construction start and finish date, cost and number of lots released.
It is important for the Developer to have a particular number of lots
available for sale each year.
Using the Gantt Chart and the Entry: Table, my project header looks like
this;
ID, Task Name, Duration, Start (Date), Finish (Date), Construction Cost ($),
Lots Serviced (No), Lots Released (No), Predecessor
I've added fields such as "Lots Serviced" and "Lots Released" as Number 1
and Number 2 Customised Fields. Among other things, i would like to produce
a lot production schedule which identifies the Numbers of Lots Released over
time. I've tried to create a report or use "Analyze timescaled Data in
Excel" to generate what i require.
How do I produce a lot production schedule which identifies the Numbers of
Lots Released over time.
Any help would be appreciated. Thanks
Troy
- 13
- Visual C#.Net >> Running code compiled in Framework 1.0 with Framework 1.1Hello,
We have an application written using Framework 1.0 (VS2002), we have
deployed it to a server that only has Framework 1.1 installed, the
client does not want to Install Framework 1.0 because it might have an
impact with other .Net applications written using Framework 1.1, so
rather not getting into a debate with the client I have agreed to
investigate if we could get our application to run using Framework 1.1
without recompiling it. Is this possible, if so how?
Thanks,
- 14
- 15
- ADO >> Column Expression questionHello!
After filling table into DataSet (ds), I added following line ...
ds.Tables(0).Columns("MyColumn").Expression = "<MyFormula>"
... and calculation is working fine - but I need to save this calculated
field value into database also because it makes easier to make SELECT
queries later and it's quite often needed value in many cases too. This
"MyColumn" is as a field in database too, and is used too when making
DataAdapter in SELECT-query.
When trying to save, I'll get error message ...
"The column mapping from SourceColumn 'MyColumn' failed because the
DataColumn 'MyColumn' is a computed column."
Is it possible to save computed column values into database table at all?
--
Thanks in advance!
Mika
|
| Author |
Message |
winstonhyypia

|
Posted: Mon Sep 03 03:04:07 PDT 2007 |
Top |
Visual C#.Net >> "Comparison to integral constant is useless; the constant is outside the range of type 'int'"
"Comparison to integral constant is useless; the constant is outside the
range of type 'int'"
How can I fix this compiler warning, please, for the following pseudocode?
int m_nError;
m_nError = somedriverapi.DoSomething();
if (m_nError != 0x8010002F) foobar; << compiler warning here
thankyou
Claire
DotNet89
|
| |
|
| |
 |
Vadym

|
Posted: Mon Sep 03 03:04:07 PDT 2007 |
Top |
Visual C#.Net >> "Comparison to integral constant is useless; the constant is outside the range of type 'int'"
Hello, Claire!
Warning is generated, because value 0x8010002F exceeds the valid range of
int type.
Due to sign information max value of int is 2^31
You can use uint instead of int. uint max value is 2^32. Or use cast to
uint.
if ((uint)m_nError != 0x8010002F) foobar;
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com
You wrote on Mon, 3 Sep 2007 10:52:42 +0100:
C> "Comparison to integral constant is useless; the constant is outside
C> the range of type 'int'"
C> How can I fix this compiler warning, please, for the following
C> pseudocode?
C> int m_nError;
C> m_nError = somedriverapi.DoSomething();
C> if (m_nError != 0x8010002F) foobar; << compiler warning here
C> thankyou
C> Claire
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Visual C#.Net |
- Next
- 1
- Winforms >> TopMost problemHi guys.
I am writing an aplication with C#.Net in VS.Net2003
I have a Mdi form wich has 2 child forms.
How can I set one of the child forms as a topmost ?.
When I set TopMost property to true it does not work.
I tried every thing but nothing helps.
Can anyone send me an example of code.
Thanks
- 2
- Microsoft Project >> Project 2003 Custom Form, macro & toolbarI have created a custom form in VB, a custom toolbar and a custom macro to
run the VB form from Project. I am able to get the custom toolbar to run the
form on my local MS Project, but when I create a template, and another person
opens the template, the custom toolbar to run the form doesn't appear. I
have gone through the riggamarole of the organizer to ensure that everything
exists in the global template and the custom template, but still doesn't work.
Any ideas?
Thanks!
- 3
- Dotnet >> ASP.NET function runs twiceI have a button on my ASP.NET form that takes information from the form and puts it into a database. However, whenever I push that button it runs the function three times instead of just once. What can I do to fix this?
- 4
- Dotnet >> including folders in visual studio.net 2003I've excluded a few things from a VS project and now I need to
re-include them but can't figure out how. I excluded a web service,
web reference and proxy file because they were part of something which
didn't need to be rolled out at the time. Only problem is that I now
need to re-include them so that I can complete the project.
Please help someone!
- 5
- Dotnet >> Defaultvalue from database in dataset columnsHi,
I have an Access database in which I defined default values for certain
columns. On my windows forms I've got controls bound to the dataset, The
problem is that when I add a new row to the dataset my controls don't have
the defaultvalue entered in the database.
Is it possible to retrieve the defaultvalue for the column from the
database?
--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl
tel: +31 162 470 534
fax: +31 162 470 502
- 6
- Winforms >> ArgumentException @ Image.FromStream(stream)I get an "ArgumentException: Invalid parameter used at
System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement)"
exception. it is too ridicilious to get such an exception, can anyone see what
might cause that exception?
(By the way, i am trying to throw the header part of the image away and extract only
the image data)
the related source code is shown below:
private void button1_Click(object sender, System.EventArgs e)
{
string file_name = @"C:/...\IM1";
FileStream fs = new FileStream(file_name, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
//BinaryReader br = new BinaryReader(File.OpenRead("C:/.../IM1"));
try
{
int numbytes = 140672 ;
int offset = 9600 ;
int totbytes=0;
byte[] bytearr = new byte[numbytes];
while( totbytes < (numbytes-offset) )
{
int i = br.Read(bytearr, offset,numbytes-offset) ;
totbytes+=i;
}
MemoryStream ms = new MemoryStream (bytearr,0,bytearr.Length) ;
Image img = Image.FromStream(ms,true);
//picbox.Image = new Bitmap(ms);
picbox.BackgroundImage = img ;
br.Close();
ms.Close();
}
catch( Exception exc )
{
textbox.Text = exc.ToString();
}
}
--------------------------------
From: halise irak
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>Dky2bOgn40+pai4RPGb7LQ==</Id>
- 7
- Visual C#.Net >> Re: PropertyInfo.GetValue - Problems with Count Property ofType ArrayList>> for( int i = 0; i < Convert.ToInt32( LengthProperty.GetValue(
>> DataSource, null) ); i++ )
>That's pretty nastily inefficient - you'll be retrieving the property
>by reflection on every iteration of the loop
Thanks for that Jon.
The code block actually was working, I was just passing an empty
collection into the datasource.
However, the Watcher still gives me the error when I place
LengthProperty.GetValue( DataSource, null) in it, I guess it is just
incappable of executing that code.
- 8
- Microsoft Project >> NotificationIs there a function to let me know when my project start and finish? My
projects have very different durations and it takeâ??s me very long to go
trough all of them to see when they must start and finish, someone told me
you can get a e-mail or notification, is it true and how do I do it?
im using ms projects 2003.
- 9
- ADO >> Can't find primary keyI have a dataset that I first do a FillSchema(dataset, SchemaType.Mapped, "Table") on, and yet it still throws System.Data.MissingPrimaryKeyException when I do a dataset.tables("Table").Rows.Find(key).
The column is marked as a primary key in the table and the sql statement is just "SELECT * FROM tableName"
Anybody have any idea why this can happen?
P.S. Sorry if I didn't give enough info, but I am patching together someone else's mess, so I haven't gotten a chance to read it all yet.
-Thanks
- 10
- ADO >> Long SQL operation - Any Expert ???Hello , All My problem is like that I m fetching data from Remote Databse
Server . The data that i want retreive is so large that it take too much
time, and system shows me error like Time Out expires. I have putted
Timeout=0 . I have also tried timeout=120 . But Problem as it is . So any
Expert Please help Me.
- 11
- ADO >> Passing parameter to store SQL procedure ???Dear all,
I am passing parameters to store procedure without any troubles but
parameters list are less than 10 parameters, still manageable.
But we have a situation where we do not know for instance the number of
variable my final customer would like to monitor and store to database.
It can be a list of 20 variabls or 50 or more...
I was wondering what is the best way to pass an unknown list of parameters
to a store procedure , can we use arrays ? XM files ?
one parameter will correspond to one table field at the end
What is the best way to do it and how ?
thanks for help
regards
serge
- 12
- ADO >> Data column expressionHi,
Consider the following code statement:
dstest.Tables("test").Select("intfield = " + CStr(intval))
Suppose table test has the column name "intfield" with
int32 datatype. Let's dataset test contain the following
rows
Test:
Col 1, Col 2, Col 3 ..., "intfield", ... ,Col 1[0-9]
* , * , * ..., 17 , ... , *
* , * , * ..., 16 , ... , *
* , * , * ..., 6 , ... , *
Could the result of the statement return 0 row if the
intval has the value 6?
It shouldn't, right? However, what we had found for the
return number of rows is really 0. Why is that?
Best regards,
KPH
- 13
- Net Framework >> Create GUID in C#How do I create a new GUID programatically like the "Create Guid" tool does
in VS.NET?
--
Jeff Lynch
"A BizTalk Enthusiast"
http://dotnetjunkies.com/WebLog/jlynch/
- 14
- Visual C#.Net >> Resource fileI have a form with about 10 data adapter, 3 connections, one dataset and
other components on it,
sometimes it goes crazy and all the inherits form tries to initialize all
the components again, like setting
again the dataset primary key, that will throw an error, all the dataapater
command become visible,
and others errors ...
What's wrong with the resource file? There is a way to fix it?
- 15
- ADO >> Accessing deleted rows problemHi everyone!
As stated in subject I have problem with accessing deleted rows within
dataset,
that is, deleted rows within table contained in dataset.
Dataset is strongly typed (generated by designer).
I need to say that I've done this by following tips in MSDN.
First I create dataset, then entity I want to add.
public void Sample()
{
TypedDataSet ds = new TypedDataSet();
ds.Tables["TableName"].Rows.Add(entity.CreationParams); //
CreationParams is property
// which returns object[] with required values
// Adding row works perfectly!
// Then, I find and delete row
DataRow dr = ds.Tables["TableName"].Rows.Find(entity.Identity) //
Identity is property
dr.Delete();
// which returns object[] with PK values
// Removing row also works perfectly!
// Now, I should be able to get those rows with "Deleted" status this
way:
DataView dv = new DataView(ds.Tables.["TableName"], "", "",
DataViewRowState.Deleted);
// But!!! dv, that is dv.Table.Rows is EMPTY!!!
// Alternatively, I've tried with ds.Tables["TableName"].Select(null,
null, DataViewRowState.Deleted);
// but no luck there :-)
}
My question is simple :-) What I am doing wrong?
Any advice, tip, suggestion, help is appreciated. Thank you very much :-)
|
|
|