|
Hi,
I can't understand what your trying to do?.
but this is what i think you r trying to do.. u have a datalist control who has a child control which has a value and u need to retrieve it.
you r going fine except that your trying to send an asp.net textbox control to be parsed as int..
TextBox t=(TextBox)dlProducts.Controls[0].FindControl('txtexamp1');
[Explicit casting required]
int qty=int.parse(t.Text);
u will have the value which u can input in Sql.
I hope this answer helps u.
<div class="signature">rajeshkasani05</div>
|
|
|
|
|
using int qty=int.parse(t.Text); produces a formatException.
|
|
|
|
|
hi,
The format Exception may be thrown because you are not receiving any value or the string from the t.Text may be "" (empty string).please try to debug and check the issue or place your code snippet and let me check it.
Regards,
rajeshkasani05
|
|
|
|
|
My code is in the first message. The user will only be entering integers not string into the text box.
|
|
|
|
|
Do not use Int32.Parse() when you do not know the contents of the input. Use the Int32.TryParse() Method[^], or put the parsing code within a try/catch block. You should also use your debugger to check the value that the code is actually trying to interpret; don't assume it's the value that you think is there.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I am getting an error in a C# 2008 application since I am trying to add the NLog open source tool to 2 different solution files.
I am completing the following task:
1. I add a reference to this dll in the references section of each proejct file.
2. I then place a 'using NLog' statment in each solution file.
No matter what I do, I can not remove 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
Can you show me code and/or tell me how to fix this problem?I am getting the following warning and error message for a C# 2008 application I am working on:
Warning 17 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\NLog\.NET Framework 2.0\NLog.dll' sample
Error 21 The type or namespace name 'Nlog' could not be found (are you missing a using directive or an assembly reference?) C:\Sample.cs 15 7 sample
|
|
|
|
|
Problem description isn't clear.
VS Studio 2008 (not C#) open a solution (one solution) which then has multiple projects.
In there you add a dll a a reference.
Then when you compile the solution you get that error.
Presumably that is what you mean.
If so I suspect that something is wrong with the compile options for the project. You can examine that in the properties of the project. You might start by looking at the targeted version of .Net that each project is using.
|
|
|
|
|
Okay, so we've identified that you and the poster below are the same person. Stop this now. Post as one person, and one person only.
[Edit]The proof is in the wording - from the post below:
"I am getting the following warning and error message for a C# 2008 application I am working on:
Warning 17 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\NLog\.NET Framework 2.0\NLog.dll' sample
Error 21 The type or namespace name 'Nlog' could not be found (are you missing a using directive or an assembly reference?) C:\Sample.cs 15 7 samplef
I am getting this error message since I am trying to add the NLog open source tool to the solution file for 3 different project files in this solution.
I am completing the following task:
1. I add a reference to this dll in the references section of each proejct file.
2. I then place a 'using NLog' statment in each proejct file.
Can you show me code and/or tell me how to fix this problem?"
From this post:
"I am getting an error in a C# 2008 application since I am trying to add the NLog open source tool to 2 different solution files.
I am completing the following task:
1. I add a reference to this dll in the references section of each proejct file.
2. I then place a 'using NLog' statment in each solution file.
No matter what I do, I can not remove 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
Can you show me code and/or tell me how to fix this problem?I am getting the following warning and error message for a C# 2008 application I am working on:
Warning 17 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\NLog\.NET Framework 2.0\NLog.dll' sample
Error 21 The type or namespace name 'Nlog' could not be found (are you missing a using directive or an assembly reference?) C:\Sample.cs 15 7 sample"
modified 14-Nov-12 17:11pm.
|
|
|
|
|
Hadn't spotted that second post yet, but reading this one I thought of another post/user(?)...
Error 19[^]
Maybe we are dealing with 'unique' users and NLog really has a problem
|
|
|
|
|
Good catch - and rachel_m has displayed a tendency to being the same user as sc steinhayse as well. Linq[^] and Linq[^].
|
|
|
|
|
We should team up mate... you can be Batman, I'll be Robin
|
|
|
|
|
The general dead giveaway for me is the use of the phrase "C# v application" where v is either 2008 or 2010. They also tend to like to use "console application" and "windows service" a lot, as well. They always seem to end the post with the same general question.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Yup. Surely one organisation can't employ that many people who can't do the job, and put them on the same task.
|
|
|
|
|
I am getting the following warning and error message for a C# 2008 application I am working on:
Warning 17 The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias;
using definition from 'c:\Program Files (x86)\NLog\.NET Framework 2.0\NLog.dll' sample
Error 21 The type or namespace name 'Nlog' could not be found (are you missing a using directive or an assembly reference?) C:\Sample.cs 15 7 samplef
I am getting this error message since I am trying to add the NLog open source tool to the solution file for 3 different project files in this solution.
I am completing the following task:
1. I add a reference to this dll in the references section of each proejct file.
2. I then place a 'using NLog' statment in each proejct file.
Can you show me code and/or tell me how to fix this problem?
|
|
|
|
|
Are you sure you did it right? Do you have reference to that dll in project that contain sample.cs? Maybe do you have errors in dependent projects? Or namespaces clash?
No more Mister Nice Guy... >: |
|
|
|
|
|
Hi,
Programatically I want to convert html file into tiff file.Can any body please help me how to do this using c#?I want to use this code in windows forms application. I just tried like below.
Image img = Image.FromFile(InputFile);
img.Save(OutputFile, ImageFormat.Tiff);
InputFile is a variable which is having path of a input html file. OutputFile is also a variable which is having path of output file.
When the first statement executed I am getting following exception.
"System.OutOfMemoryException: Out of memory"
Thanks in advance.
modified 14-Nov-12 7:41am.
|
|
|
|
|
See here[^], you cannot load an HTML file into an Image object, the file must be a valid image type.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi Richard,
Can you please tell me how to convert a html file into tiff format using C# code programmatically?
|
|
|
|
|
It's easy enough to find. Click this[^].
|
|
|
|
|
Downvoted this because you just repeated your initial question without apparently having read the content of the post you replied to.
HTML is not an image format. What you are asking makes no sense.
|
|
|
|
|
Is it possible to get current user's password using "MAPI"
in c#?
if yes than how?
Thanks
|
|
|
|
|
Errr no. It would be a massive security hole if you could.
Why would you even want to do this?
|
|
|
|
|
actually i want to get my password after log in in outlook i could get my email address but not password is it possible to know my password using MAPI in c#
|
|
|
|
|
Wow. Did you even read Pete's answer?
No more Mister Nice Guy... >: |
|
|
|
|
|
Sanjeev9918 wrote: is it possible to know my password using MAPI in c#
Maybe if I put it another way. NO! It would be a massive security hole if you could. Massive as in the press would be screaming for someone's head. Questions would be asked by governments. The world will tilt off its axis. NO!!!
|
|
|
|