|
hi
I want to please your comments and advice in a project:
the idea is to write and read from a text file format by checking the size of what is going to write or read, is like creating a table in sql server and fill in according to the size of variables declared
if you Propostion in that sense I thank you very much.
|
|
|
|
|
This isn't very clear, but I think you are asking for help on how to write out a fixed-width column text file?
You can use a StringBuilder object to append lines.
You can use the PadLeft and PadRight methods on a string to create equally sized columns.
If this is not what you are after, please clarify your question a little.
Cheers,
|
|
|
|
|
ok, i should write in the text file to a value that must not exceed 14 characters, how to do that???
|
|
|
|
|
Check the value of string.length to make sure it doesn't exceed 14:
if (!yourstring.length>14)
{
}
Cheers,
|
|
|
|
|
Hi
I developed a C# winform ping application (runs in background to perform periodic pings) and I use a service to keep it running. The application writes to a database (triggered by periodic pings). The app and service are hosted on an application server.
Problem: Application doesn't write to database.
Observation: It might have something to do with login because when I start the application manually it works (writes to database periodically) - the application icon shows on my system tray. As soon as I log off, and login again, my task managers shows that the application and the service are running (as processes), yet the application is not visible to the desktop (no icon on system tray).
Question: Is my approach flawed? Are there other ways of getting to run routines without having to login to a system (cause as soon as one logs off, the app stops)
I would appreciate a some light from anyone.
Thanx
...And there was Fufununu in da heeezay!
|
|
|
|
|
Q: Why not let the service do the pinging and let it write to the database?
Does the failed write attempts from your application generate any exceoptions or errors that could be helpful?
|
|
|
|
|
Thanx Calla
No exceptions are generated. However, I will explore the option of making the service write to the database and just eliminate the functionality on presentation layer. I could use the app to only set ping intervals.
...And there was Fufununu in da heeezay!
|
|
|
|
|
OK, make sure you use a valid user account when writing to the database. This is probably what is causing your problem.
|
|
|
|
|
Wie_Funu wrote: Observation: It might have something to do with login because when I start the application manually it works
When you run the application "manually", then it will run under the account of the user that's currently logged in. When you run it as a service, then there's no logged-in user.
What account[^] are you using for the service?
I are Troll
|
|
|
|
|
I'm using the system account
...And there was Fufununu in da heeezay!
|
|
|
|
|
Wie_Funu wrote: I'm using the system account
The local system account, called "NT AUTHORITY\SYSTEM"? I doubt that it has the rights to write to Sql Server.
Either you run it when the user is logged in, or you change the user under which it runs.
I are Troll
|
|
|
|
|
Why did you separate the app from the service? You could have just used the windows scheduler for this. I would recommend that you combine the app into the service.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I think a single windows app is good enough, just create a win service app use storedprocedure with output parama to fetch the data manipulation result, In case of any runtime error write the error into the event log. Note that you need windows authorization when you install the service.
Thanks
Md. Marufuzzaman
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
I agree with having the service doing the pinging and writing to the database -- I've done that in the past. Just be sure it runs under a user which has access to what it needs. I believe it's best to have a user which is created specifically for running the service and accessing the database.
I also put the service's configuration (e.g. how frequently to cycle) in the database and have it retrieve the configuration on each cycle. This allows me to alter the configuration without stopping the service.
|
|
|
|
|
Hi,
its a desktop application in c#..i have to play multiple videos in media player..for which i have to create playlist in c#...can anyone help me how to create playlist in c# to play multiple videos in windows media player..
Regards
Tanzeel...
|
|
|
|
|
media player sample play list
<?wpl version="1.0"?>
<smil>
<head>
<meta name="Generator" content="Microsoft Windows Media Player -- 9.0.0.3250"/>
<author/>
<title>JALSA</title>
</head>
<body>
<seq>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\05 - Jennifer Lopez.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\06 - Gaallo Thelinattunde.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\07 - Chalore Chalore Chal (Hindi).mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\08 - My Heart is Beeting (Remix).mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\09 - Jalsa (The Devi Mix).mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\10 - Importance of Blood Donation.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\01 - Jalsa.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\02 - My Heart is Beeting.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\03 - You & I.mp3"/>
<media src="E:\Old Drive Data\Rajesh IMP\entertainment\Jalsa\Jalsa\04 - Chalore Chalore Chal.mp3"/>
</seq>
</body>
</smil>
thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
its desktop application in c#...not asp.net
|
|
|
|
|
That's not ASP.NET code; What you are looking at is the file-format, which is loosely based on XML. Write your data in the same format and MP will be able to read it.
I are Troll
|
|
|
|
|
Take a look at Create a Windows Media Player List[^] from here on Code Project.
Remember, Google/Bing is your friend!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Shall we replace all the Hash tables with Dictionary?? Other than boxing-unboxing any other difference between these two?
My small attempt...
|
|
|
|
|
Have a look at This[^], You'll get your answer.
|
|
|
|
|
i could not find the answer for my question with your 'google assist'. Please check your search and let me know whether is saying the answer for my question
My small attempt...
|
|
|
|
|
sujithkumarsl wrote: i could not find the answer for my question with your 'google assist'. Please check your search and let me know whether is saying the answer for my question
That's a bit rude, dude. Yeah, it's monday again
Anyway, to answer your question; both Hashtable and Dictionary are present in the framework. If one could replace the other, wouldn't they just "drop" one? There's some subtle differences between the two, and even though the behave similar, they're not exactly the same.
So, it's no good to replace all traffic-signs, you'd have to go down to the street and judge the situation at hand.
I are Troll
|
|
|
|
|
we should not encourage unnecessary replies, that why i did it...
Yes you got my correct question.. Now I want to know in what situation I can not replace Hashtable with Dictionary. Please put some more lights
My small attempt...
|
|
|
|
|
i think i got it finally
Here it is
My small attempt...
|
|
|
|