|
No problem. Post back if you have any more problems
Dave
|
|
|
|
|
When I used to code console apps for C++, my program could take runtime arguments, like
int main ()
{
return 0;
}
How can I do something similar to this in C#? I am running a windows form application, and when I tried static void Main(string open) it gave me an error saying it wasnt a proper place for program entry.
How can I accomplish this?
Thanks in advance.
|
|
|
|
|
That Asian Guy,
static void Main(string[] args)
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Wow that was easy. Thanks :P
|
|
|
|
|
Yeah, what he said, plus
static int Main ( string[] args )
{
return 0;
}
|
|
|
|
|
Ah, somebody as pedantic as I am about Main returning an int.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Vikram A Punathambekar wrote: as pedantic
If not moreso.
No reason not to and it's going to anyway, why not control it?
|
|
|
|
|
I am trying to set the following registration in my aspx so I can bind a wcf service to an AutoCompleteExtender:
]]>
However, the compiler returns the following error:
"The directive 'servicehost' is unknown"
I have added the following "using" directive to the codebehind:
using System.ServiceModel;
I have added servicehostingenvironment aspnetcompatibilityenabled="true" as a child element of system.servicemodel in Web.config.
What am I missing?
NOTE - This forum software automatically wraps the directive tag above with "CDATA"
|
|
|
|
|
Did you add a reference to System.ServiceModel?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I am trying to return Count(*), cast to a String and assign the value to Label1.Text. I am a bit stuck on the C# syntax because I am new to C#. This is what my research has produced thus far:
protected void Button1_Click(object sender, EventArgs e)
{
using (SqlConnection conn = new SqlConnection(ConnString))
{
//String newTagName = txtParm.Text;
int DOWcount = 0;
SqlCommand cmd = new SqlCommand("SELECT count(*)FROM RealTime WHERE DATEPART (d,CallStartTime) = DATEPART(d,getdate())", conn);
cmd.Parameters.Count;
conn.Open();
DOWcount = cmd.ExecuteNonQuery();
Label1.Text = DOWCount.ToString();
I know that I am not using the "cmd" correctly. Can anyone of the experts out there steer me in the right direction?
|
|
|
|
|
mreynol5 wrote: Can anyone of the experts out there steer me in the right direction?
No. No one knows how to do that. And if anyone did it certainly would not be Microsoft and they certainly would not document it.[^]
And you certainly would not be able to find the documentation using Google[^]
mreynol5 wrote: I am a bit stuck on the C# syntax because I am new to C#.
Ok, good luck
led mike
|
|
|
|
|
Change this:
DOWcount = cmd.ExecuteNonQuery();
to this:
DOWcount = (int)cmd.ExecuteScalar();
Hope that helps
|
|
|
|
|
Hi,
In part of my undo/redo system (for property value changing on certain component types which must be recreated) it would be very useful to create a copy instance. Now I have achieved this using the designated 'CreateInstance' method as provided by the type converter. My problem is understanding exactly how to get the propertyValues 'IDictionary' type object.
I have created the following method which works, but I wanted to know if anybody has any suggestions to improve this or perhaps if there is an easier way. I am worried that this approach may cause issues, would property descriptor attributes need to influence this process in some way?
protected object CreateInstanceCopy(PropertyDescriptor descriptor, object component)
{
PropertyDescriptorCollection propertyValues = descriptor.Converter.GetProperties(component);
Dictionary<propertydescriptor, object=""> values = new Dictionary<propertydescriptor, object="">();
foreach (PropertyDescriptor desc in propertyValues)
values.Add(desc, desc.GetValue(component));
...
return descriptor.Converter.CreateInstance(values);
}</propertydescriptor,></propertydescriptor,> Thanks,
Lea Hayes
|
|
|
|
|
hi...
i'm using crystal reports with C#. I'm using an ODBC connection for the report.
when trying to open the report from test machine it gives this window.
.........................................
Databse login .
.........................................
server name: .
DataBase: .
LoginID: .
password: .
.
integrated security (checkbox) .
.........................................
how can a reomve this window
|
|
|
|
|
shabonaa wrote: how can a reomve this window
Click the red 'X' in the upper right corner
led mike
|
|
|
|
|
Hey Shabonaa,
What you need to do is programatically set that in the page load or report load event using code behinds.
The only way I found to easily remove the window is to load the crytsal report in the code behind page and NOT in the .aspx
Does this make sense?
You should google "crystal reports c# programmatically" and sift around for something close to what you are doing.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
|
|
|
|
|
i'm using a windows application. not asp
|
|
|
|
|
hmmm. should still be doing it programmatically then.
you should still be loading up the report and passing logon credentials through the C# code. if not in a code behind, then in a class file. but you will have to do it that way.
You should google "crystal reports c# programmatically" and sift around for something close to what you are doing.
-----------------------------------------------------------
"When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
modified on Tuesday, May 20, 2008 6:16 PM
|
|
|
|
|
You have to provide the login information (programmatically), even though you have done that in the Crystal Report designer.
|
|
|
|
|
hi again
i got a tableLayoutPanel in my form that contains Checkbox in each cell. now i want now the Cell(Row,Column) if user checked one box.
i know that tableLayoutPanel add a Cell property to it's chid and i can see that in Properties Window but the problem is i can't use this in code.
thanks for help
|
|
|
|
|
I have five ToolStrip within a ToolStripContainer.
when I on/off visibility of these toolbar from, These toolstrip seems appear in random order.
ToolStrip grips are enabled.
How can fix the order of appearance of these toolstrips within toolstripcontainer. Some Toolstrip should apprear in the same row and some toolstrip should appear before of after any other Toolstrip when in the same row.
Any idea will be appreciated.
Thank you.
|
|
|
|
|
Might sound like a silly question, but jeez it's really not obvious to make those toolstrips behave.
I'm really really interested in the solution too !
|
|
|
|
|
Hi,
I am working on an application that is able to read data from a keyboard wedged barcode scanner.
I want the barcode that is scanned to be displayed in a picture box in my form.
I use the code discribed in http://www.codeproject.com/KB/macros/BarcodeLibrary.aspx
to draw the barcode. Therefore I need 2 things :
1) the data to be encoded.
2) the type of the encoding (Code39, Code128, UPC A, UPC E, EAN13 etc..)
Since most barcode scanners are able to read several barcode types, is it possible to determine the type of the encoding the barcode reader uses to generate the data from a barcode image?
TIA
|
|
|
|
|
|
1. I created my own DLL in C++ (MyMathDll.dll), wrote a client program in c#. The program works on x86 system (32bit) but when i run it on x64 (64bit vista), I get the error, BadImageFormatException. It is simple function which adds two numbers as follows
int _cdecl Add(int x, int y)
{
return (x+y);
}
2. I have another problem with x86 windows. It is not able to load or even locate a particular dll. The dll was made with nmake utility? Could there be something wrong with the DLL. It locates other dlls fine. I verified this DLL in dumpbin and it looks good. Why it is not loadig?
|
|
|
|