|
Hi,
Who here has used or knows about code that exports a datatable to excel, that handles quotes ". Try any.
I'll appreciate your help.
Let's do this !
|
|
|
|
|
Nice try maite
Original Post Link[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
Nopes, its of today and just 6 hrs back
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Where are you getting the data? If you are querying a database to fill the DataTable then you could perform the Replace when you do the query.
|
|
|
|
|
hi all,
I think this might be the simple question,but i got stuck.Can we pass an interface as a parameter to a method?
Thanks in Advance
|
|
|
|
|
Yes. If the parameter type is an interface then you can pass an object which implements it
|
|
|
|
|
You certainly can, and this is actually good practice if you want to use certain design patterns. For instance, you may want to use the Inversion of Control (IoC) pattern which is heavily pattern based.
|
|
|
|
|
I have some code which has to be able to know whether a file can be opened, if so, open it, if not, try again. In C++ I would use CreateFile() and test if the returned handle was valid. In C# it looks like I would have to use new FileStream() and wait for an exception to be thrown which seems to slow. Is there any way I can instantly tell if a file can be opened?
|
|
|
|
|
File.Open Although it is basically the same thing.
Waiting for the exception will not be slow though. You try to open the file, and if it can't it tells you so in the form of an exception. If no exception is thrown then you know the file has been opened succesfully.
It's probably much better than calling CreateFile then checking the handle.
__DanC__ wrote: Is there any way I can instantly tell if a file can be opened?
The only way is to try and open it. How do you know if a door is locked if you don't try to open it first, psychic powers?
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
That's what I thought, it just seemed slower when catching the exception and retrying.
|
|
|
|
|
|
Thanks for the link but even the referenced articles state that exception handling should not be used used in normal application flow, they should be as the name says "exceptions" whereas in my application it is perfectly possible that another process or thread may have the file open and so I need to retry until it becomes available.
On a side note, when using FileStreams it also seems that the internal file handle is not closed immediately (they are used within a using block) as I get a lot of exceptions opening files that were previously open and are no longer open.
|
|
|
|
|
If the file is opened within a thread you control, then perhaps you could set something up to track which files you have open. Then you could just check against the tracker.
Perhaps this tracker could also fire events so that other threads wouldn't have to keep checking to see if the file is available. Maybe even a waiting list so you can see how many threads are waiting to open a file, you could even prioritize the list.... the possibilities are endless. But err, maybe just a list of files you have open.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Asalamoalekum all,
friends my objective is to achieve indexing of any video(any format DVD, AVI etc) on the basis of the vocal emotions like humourus, tradegic, action. video should be segmented into scenes(in respective categories) on the click with respect to the frequencies spectrums(patterns) of the voices in the video.
can anybody guide me any way to achieve this goal.
how should i take a start to it in C# ??
please highlight basic features that will be required to accomplish my target!
please suggest any software to download which can covert audio frequencies to values!
thanking you!
waiting for reply.......
God bless you all!
regards,
Sana
$@N@
|
|
|
|
|
Can you please explain what your purpose is by indexing video in such a way. May be there is a work around.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Thanks to all of you for giving response!
from INDEXING VIDEO i mean:
any interface which allow opening a video, then if i want to have look at only humours scenes in the video i just click a button(whose back coding is fixed with particular audio frequency range which helps in identifying humour in conversation) and all the scenes which contain humour in it are all listed and then i can click them one by one to enjoy..similarly with the other types of emotions(tradegic, action)... HOPE U GOT MY POINT!
"ITS NOT MY FINAL YEAR PROJECT"
"I am not well knowned to C# so dont know whether it has any contro which allow video adding...as it allows image adding using picture box....please guide me"
again thanks in advance for further help!
$@N@
|
|
|
|
|
sana17 wrote: how should i take a start to it in C# ??
please highlight basic features that will be required to accomplish my target!
It sounds like you are well out of your depth here. I would try a simpler project and build up to something like this.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I would recommend hiring a programmer to do the work for you.
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
sana17 wrote: can anybody guide me any way to achieve this goal.
Complex sh*t... You should have knowledge of:
- video file formats
- digital signal processing
- data mining & expert systems
This sounds like a final project for college. Am I right?
|
|
|
|
|
sana17 wrote: Asalamoalekum all,
What does it mean?
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hello everybody .
I have a little problem. I have a little problem. I have added the TextboxColumn to the datagridview. I want to add event keyUP to that TextBoxColumn. How can I do this?
please provide some some solution.
|
|
|
|
|
You wouldn't create a KeyUp event for the column, you would need to create the event for a DataGridViewTextBoxCell[^] in that column
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Hi I am writing a netflow collector in C# and for some or other reason the TcpListener object does not go into a pending state as the netflow packets arrive. Does anybody know of a workaround for this. The code follows
<pre>
using System.IO;
using System.Net;
using System;
using System.Threading;
using N = System.Net;
using System.Collections;
class TalkServ
{
System.Net.Sockets.TcpListener server;
protected String file = "";
protected int port = 4055;
public static void Main(String [] args)
{
TalkServ TS = null;
try
{
TS = new TalkServ(args[0],args[1]);
}
catch (Exception e)
{
Console.WriteLine("\nMust specify a file path as first parameter...\nThe file is used to capture netflow data...");
Console.WriteLine("\nMust specify a port as second parameter...\nThe port is the netflow port...");
}
}
public TalkServ(string f,string p)
{
port = Convert.ToInt32(p);
server = new System.Net.Sockets.TcpListener(port);
file = f;
while (true)
{
server.Start();
if (server.Pending())
{
N.Sockets.TcpClient connection = server.AcceptTcpClient();
Console.WriteLine("Connection made");
BackForth BF = new BackForth(connection,file);
}
}
}
}//end of class TalkServ
class BackForth
{
N.Sockets.TcpClient client;
System.IO.StreamReader SR;
string file;
public BackForth(System.Net.Sockets.TcpClient c,String f)
{
client = c;
file = f;
Thread t = new Thread(new ThreadStart(init));
t.Start();
}
private void run()
{
try
{
string l = "";
while (true)
{
l = SR.ReadLine();
if (l != null)
{
if (!l.Equals(""))
{
StreamWriter writer = new StreamWriter(file, true);
writer.WriteLine(l);
writer.Close();
Console.WriteLine(l);
}
}
}
}
catch (Exception e44) { Console.WriteLine(e44); }
}
private void init()
{
SR = new System.IO.StreamReader(client.GetStream());
Thread t = new Thread(new ThreadStart(run));
t.Start();
}
}
</pre>
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
I found this site called MSDN, it has so many answers, like the following:
Remarks
This non-blocking method determines if there are any pending connection requests. Because the AcceptSocket and AcceptTcpClient methods block execution until the Start method has queued an incoming connection request, the Pending method can be used to determine if connections are available before attempting to accept them.
Wow!
|
|
|
|