|
You have already posted this question in the .NET Framework forum[^].
Posting the same question in multiple forums on the same site is only going to annoy the people who would otherwise be trying to help you.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
// datagridview name is dgdaily.
i got error
"System.NullReferenceException occurred
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=final
StackTrace:
at final.DailySheet.UpdateLabelText() in h:\final\final\final\DailySheet.cs:line 122
InnerException:
"
//my code start
updatelabeltext()
{
Label[] la= new Label[10];
int counter1;
int counter2;
int i = 0;
for (counter1 = 0; counter1 < (dgdaily.Rows.Count-1); counter1++)
{
int sum = 0;
if (dgdaily.Rows[counter1].Cells["destination"].Value != null)
{
string x = dgdaily.Rows[counter1].Cells["destination"].Value.ToString();
int descount = 1;
for (counter2 = 1; counter2 < (dgdaily.Rows.Count-1); counter2++)
{
string y = dgdaily.Rows[counter2].Cells["destination"].Value.ToString();
if (x==y)
{
descount++;
sum = descount - 1;
}
}
la[i].Text = dgdaily.Rows[counter1].Cells["destination"].Value.ToString()+":" + sum.ToString();
i++;
}
}
}
|
|
|
|
|
Member 10991491 wrote: StackTrace:
at final.DailySheet.UpdateLabelText() in h:\final\final\final\DailySheet.cs:line 122 Which line of your code snippet is line 122?
Member 10991491 wrote: InnerException: What's the inner exception?
|
|
|
|
|
Hi,
I need a code for printing a receipt in a WPF (C#) application using PrintDocument or another one else.
Thanks
|
|
|
|
|
OK. The only code you're going to get is the code that YOU write yourself.
Nobody here is going to do it for you and just Googling around for "print a receipt from a WPF app" is going to get you some vague code samples that you're going to have to adapt anyway.
|
|
|
|
|
your code is totaly right but still some thig error is held in this code so please check it oncve again please
|
|
|
|
|
Uhhh...Just who do you think you're replying to?
|
|
|
|
|
|
|
|
Another way is:
1. Create RDLC or Report File for as per your print document requirement.
2. Assign DataSet to you report file.
3. Create PDF file in specified location.
4. Using Browser control you can show it in pdf viewer in you apps.
5. And Generate print from pdf viewer.
|
|
|
|
|
I have a web service and i send parameters date the it's give me exception string is not in good format my code is in v.b. and web service language is c#
|
|
|
|
|
At a guess, it's a string - or you wouldn't be converting it. Which implies the service computer and the application computer are using different locales, or cultures.
Don't - pass it as a date value: always keep values in the most sensible datatype, rather than strings...
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Djay Hole wrote: web service language is c#
No web service is web service. It might be implemented in C# but that doesn't change anything.
Djay Hole wrote: exception string is not in good format my code
The web service expects a web service call with the data in the format that it expects. And you are not sending it that way. Figure out the correct format and send it that way.
|
|
|
|
|
Look into the DateTime ToString[^] method and the DateTime TryParseExact[^] methods.
Although you could just pass the Date or DateTime objects as is? Chances are it is compatible. But for the record, I'm assuming you're talking VB.Net?
|
|
|
|
|
I have picturebox and i trying write code when the users loads another image on picturebox the old file which was in picture to be deleted. I trying to find solution for for 24 hrs still i didn't able find fully working solution.
I came up with 1 partial solution and following is partial code
profilePictureBox.Dispose();
PictureBox Disappears But File Delete Successfully.
try
{
if (File.Exists(oldfilename))
{
File.Delete(oldfilename);
profilePicPictureBox.Load(picPath);
}
else
{
MessageBox.Show("File Not Found");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
"old filename" will contain previous filename to delete and "picPath" will contains new path of image user chosen.
and also when tried method like
profilePictureBox.Image = null;
i am getting below error
System.IO.IOExecption:The Process cannot access the file
'filepath' because it is being used by another process.
|
|
|
|
|
Your picture box is referencing the file on the hard disk, you need to set the content of the picturebox to null BEFORE attempting to delete the file. OR load the new file into the picturebox (releasing the old file) and then delete the old file.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This is an long known problem - see this[^] SO answer.
/ravi
|
|
|
|
|
Hi friends,
I am facing a problem in asp.net that i want to add a text box (it is a part of header of the page) in the head part of the master page without defining it into the form tag but when i run this on web page then it show the following error:
Exception Details: System.Web.HttpException: Control 'TextBox1' of type 'TextBox' must be placed inside a form tag with runat=server.
so how should i do.
|
|
|
|
|
|
The error message is pretty clear: every TextBox control must be within a <form runat="server">...</form> tag. You cannot have a TextBox outside of the form tag.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
A text box is supposed to be in the form tag itself. Why do you want it to be in outside of the form tag .
So much complexity in software comes from trying to make one thing do two things.
Sibeesh
|
|
|
|
|
I am looking for a treeview control (C#) in which it accepts a Newick string as input and draw it but I did not find any thing.
Could anybody help me?
|
|
|
|
|
Abolfazl Ghavidel wrote: but I did not find any thing. We don't write new tree-controls for each format out there. You would have to write an adapter that transforms your data to what a normal treeview expects.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I want to create a photo gallery in C#(Windows Application). Please help me to create this application.
Thanks
prabhat Kumar Mishra
|
|
|
|