|
1) never write "URGENT", coz we don't care if this urgent or not
2) store your last file name (in registry, configuration file, etc.)
3) increment filename as you wish then store it agains
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
This is my first program in c#.
I got the logic, but lack with the features and code.
Can u plz help me with the code
Thank you for your response...
|
|
|
|
|
using (StreamWriter sw = File.CreateText(fileName))
{
sw.Write(data);
}
using (StreamReader sr = File.OpenText(fileName))
{
String contents = sr.ReadToEnd();
}
|
|
|
|
|
I current have code to add the SQL Parameters to a array but when searching I need to sometimes not include the SQLParameter as its not required in the search. A example of my SQL Parameters is below which is passed to a function that runs the query.
SqlParameter[] sqlparams = {
new SqlParameter("@EventID", EventID),
new SqlParameter("@Status", Status)
};
I tried to use the following code but it produces a error if one of the two values is not in the query string (I do not insert the EventID or Status in the query string if its not being search)
SqlParameter[] sqlparams = {
EventID.Trim().Equals("") ? new SqlParameter() : new SqlParameter("@EventID", "%" + EventID.Trim() + "%"),
Status.Trim().Equals("") ? new SqlParameter() : new SqlParameter("@Status", "%" + Status.Trim() + "%")
};
What can I do to not include the @Status in the sqlparams if its empty?
|
|
|
|
|
If the stored procedure you are using for your search takes both eventID and Status field then you need to pass both the parameter otherwise always error message will be thrown. My suggestion is either you use different stored procedure for different combination of search criteria or handlle it on the single stored procedure depending upon the value of SQL parameter.
|
|
|
|
|
When you don't need SqlParamater just set its value to DBNULL
|
|
|
|
|
I have setup a Smart Device Cab Installer and it works except it keeps installing a shortcut to my help file in the Programs directory. Here is what my .inf file looks like. My help file shortcut is set to only install into Windows\Help but keeps installing the both Windows\Help and Windows\Start Menu\Programs. Any suggestions on what I am doing wrong.
[Version]
Signature="$Windows NT$"
Provider="AgTrax Technologies"
CESignature="$Windows CE$"
[CEStrings]
AppName="???"
InstallDir=%CE1%\%AppName%
[Strings]
Manufacturer="???"
[CEDevice]
VersionMin=4.21
VersionMax=6.99
BuildMax=0xE0000000
[DefaultInstall]
CEShortcuts=Shortcuts
AddReg=RegKeys
CopyFiles=Files.Common1,Files.Common2,Files.Common3,Files.Common4
[SourceDisksNames]
1=,"Common1",,"C:\????\Windows\????\????\Htm-Help\"
2=,"Common2",,"C:\WINDOWS\Fonts\"
3=,"Common3",,"????"
4=,"Common4",,"C:\????\Windows\????\????\obj\Release\"
[SourceDisksFiles]
"????.htm"=1
"timesbi.ttf"=2
"Symbol.Barcode.Design.dll"=3
"????.exe"=4
[DestinationDirs]
Shortcuts=0,%CE2%\Start Menu
Files.Common1=0,"%CE2%"
Files.Common2=0,"%CE15%"
Files.Common3=0,"%InstallDir%"
Files.Common4=0,"%InstallDir%"
[Files.Common1]
"????.htm","????.htm",,0
[Files.Common2]
"timesbi.ttf","timesbi.ttf",,0
[Files.Common3]
"Symbol.Barcode.Design.dll","Symbol.Barcode.Design.dll",,0
[Files.Common4]
"????.exe","????.exe",,0
[Shortcuts]
"????",0,"AgCount.exe","%CE17%"
"???? Help",0,"????.htm","%CE2%\Help"
[RegKeys]
"HKCU","SOFTWARE\????\????","(Default)","0x00000000",""
"HKCU","SOFTWARE\????","(Default)","0x00000000",""
|
|
|
|
|
I am scartching my head and couldn't find a solution from last 2 hours. The problem is that my
Text color is not same when doing the printpreivew. It's an aqua color, hex value= "00FFFF". When i apply this color on a text it's look aqua and little bright but i look at the same text during the printpreview mode it's a bit dark. How can i make the two color same.
I hope you can help me out.
Thanks
|
|
|
|
|
Hello,
I have a fundamental issue w/ some programs that I write, where I am logging status to ListView controls. The issue is mainly that whenever a new status line is displayed, the ListView in question takes away focus from another part of the application.
My program runs a few functions that each report to their own ListView. So, for example, scrolling through one will get interrupted if an update is made to another one.
I'm curious if anyone has any suggestions as far as how to either approach this a better way, or perhaps make a modification to my current setup.
I really like having a ListView control dynamically update with new status (not even specifically for logging purposes, but just in general). But it is very frustrating to have focus taken away when updates are made to the list.
Thanks very much for any feedback.
-Matt
|
|
|
|
|
Hi
I am trying to parse the contents of the PDF with iTextSharp using :
PdfReader reader = new PdfReader("Test.pdf");
reader.GetPageContent(pageNumber);
byte[] pageContentByteArray;
I am using this byte array to search for a partcular text based on a Delimiter pattern by converting this to string by using -
string test = Encoding.ASCII.GetString(pageContentByteArray);
The required text pattern can be matched inside this string.
The above logic works absolutely fine if we use a normal PDF input file.
My requirement is to read a PDF file which is created by CRYSTAL REPORTS (Version-9).
I have a byte array with me. But I tried to convert to string using ASCII, UNICODE , UTF8
string test = Encoding.ASCII.GetString(invoicePageContentByteArray);
string test = Encoding.Unicode.GetString(invoicePageContentByteArray);
string test = Encoding.UTF8.GetString(invoicePageContentByteArray);
I could not find the text pattern in the output string. I guess the PDF generated out of crystal reports is using some other encoding format.
(Note : We verified the template used by crystal reports to generate the PDF. The search delimiter pattern is defined as the Text object)
Can anyone suggest ideas to resolve the above problem.
Thanks,
Uma
|
|
|
|
|
1. Read the forum guidelines.
2. No one cares if it is urgent.
3. Use the code tags.
Blog link to be reinstated at a later date.
|
|
|
|
|
leckey wrote: No one cares if it is urgent.
True, just mark as abuse afterwards.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I gave him a break since he is new.
Blog link to be reinstated at a later date.
|
|
|
|
|
Must be just me, being down with the flu today
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Ick. I know how that feels. If you have chest issues I tried an old wives' treatment of vicks vaporub on the feet and socks. It did seem to help some.
Blog link to be reinstated at a later date.
|
|
|
|
|
Not sure if it was a 24 hour flu thing or food poisoning. Regardless of which ever it was, Campbell's Chicken Noodle Soup and Green Tea seems to be doing the job
Feeling better enough to go for Chicken Enchiladas for dinner.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Stop this abuse. I am looking for genuine answers.
|
|
|
|
|
vinoo80 wrote: I am looking for genuine answers.
Good luck to you
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Paul Conrad wrote: vinoo80 wrote:
I am looking for genuine answers.
Good luck to you
Aye. Especially on the CodeProject forums it seems!
What ever happened to this place?
|
|
|
|
|
I don't think the text encoding is your problem. Based on a quick Google search, it looks like GetPageContent doesn't do text extraction for you. It just returns the uncompressed operator stream. You will need to get cozy with the PDF file format and parse those operators to extract the text from the operators. You will also need to use heuristics to figure out how to put the text back together, because text operators don't necessarily appear in the pdf file in the same order as they get displayed. Even then it may not be possible to accurately extract the text.
Here's an example of how you'd miss the text given the method you're using now. Searching for "Test" with the following operators would fail:
(T) Tj
(e) Tj
(s) Tj
(t) Tj
And here's an example of where you'd probably never find the text no matter what you do:
1 0 0 1 100 0 Tm
[(t) -10 (s) -10 (e) -10 (T)](TJ
These operators display "Test", but the text you'd likely extract is "tseT".
And don't forget to parse the form resources as well. Some pdf file creators like hiding text in forms. And by forms I don't mean forms that you fill out. See the PDF spec for info on form resources.
PS: In the future, don't bother saying your question is "Urgent". No one cares, and it's more likely to have your question ignored. I replied because it was a reasonable question and you showed that you at least made a little effort to figure it out yourself.
|
|
|
|
|
Thanks a lot, for the valuable inputs. Let me take this from here and report here if I find any solutions.
|
|
|
|
|
I'm no stranger to programming, but I am brand new to programming with databases. I use MS Visual C# 2005. I have tried making forms with datasets and table adapters and it looks just fine... that is, until I try to make a change.
I have a simple form with a single datagridview. I edit the records, click the Save button on the binding navigator, the tableadapter.Update() method returns the correct number of updated rows, but when I close the program and re-open it, the changes aren't there.
Am I leaving out something? Is there extra code needed? etc.?
Thanks.
|
|
|
|
|
danielhasdibs wrote: Am I leaving out something?
Yes.
danielhasdibs wrote: Is there extra code needed?
Yes.
danielhasdibs wrote: etc.?
Yes.
Seriously though, there are any number of things that could be wrong. Is your query for fetching the data to initialize your grid view somehow filtering out the new rows? Are your updates part of a transaction that is never committed? If you are running SQL Server and have all the client tools, see if you can run "SQL Profiler" to see what queries are being run when you save your data.
--
gleat
http://blogorama.nerdworks.in[ ^]
-- Number Two's eyes narrowed and became what are known in the Shouting and Killing People trade as cold slits, the idea presumably being to give your opponent the impression that you have lost your glasses or are having difficulty keeping awake. Why this is frightening is an, as yet, unresolved problem. -- HHGTG
|
|
|
|
|
Well, can you provide a sample of the code so folks can see what is going on?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Here is what I do:
I open a new project,
I create a database,
I enter one table into the database,
I add three or four records to the table,
I add the database as a data source,
I drag the table from the data source to the form to create a datagridview,
I run the program,
I edit/add records on the form and click the Save button from the binding navigator,
I close the program,
I re-open the program,
and the changes are not there.
What am I missing?
Here's the code for the save button click event:
private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.customerBindingSource.EndEdit();
this.customerTableAdapter.Update(this.myCompanyDataSet.Customer);
}
|
|
|
|
|