|
|
Hi, thanks for your response.but i don't want to creat any Report with Crystal Reporter.
I want to use Object Reporting with ReportViewer tool in C#.
D.Riazi
|
|
|
|
|
hi
In One System I am having One webservice.and in another system i have developed one Application that contain Only one textbox.
Actually in previous senario v r writing exceptions in eventlog or in trace.
but in my case,it has write tht perticular exception directly into TextBox with out saving r using files.please give me some suggestions to do.
thanks in advance
regards
prasanna
prasanna
|
|
|
|
|
Hi,
i have an c# Form implements AxMozillaBrowser control and
try to call the navigate method.
But I get the following error: "The operation timed out when attempting to contact http://www.google.de".
Im behind a proxy server. I put the proxy values in "about:config" .
Has anybody an idea?
thx in advance
|
|
|
|
|
Hi
Can any one tell me how to upload an Excell file to FTP using c#.
Thanks in advance
Prakash
PR
|
|
|
|
|
Uploading to an ftp doesn't depend on the type of file, it's the same process for all files. Did you try searching on google or codeproject? There are lots of examples showing how to do it
|
|
|
|
|
Following code is working fine for word document
but incase of excel it is in binary format
// Get the object used to communicate with the server.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://172.22.4.14" + @"/" + "E3764_DetailedLevelDesign.doc");
request.Method = WebRequestMethods.Ftp.UploadFile;
// This example assumes the FTP site uses anonymous logon.
request.Credentials = new NetworkCredential("Danaher", "Motion$123");
// Copy the contents of the file to the request stream.
StreamReader sourceStream = new StreamReader("c://E3764_DetailedLevelDesign.doc");
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
sourceStream.Close();
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
response.Close();
when i try to open the excell file in IE it is not in redable format.
|
|
|
|
|
Reddy Prakash wrote: StreamReader sourceStream = new StreamReader("c://E3764_DetailedLevelDesign.doc");
byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
You are reading the file as if it was a text file, this doesn't work for any binary file. If you have managed to open .doc files uploaded with this code, you have only been lucky that the files have not been too badly corrupted.
Use the File.ReadAllBytes method to read the file into an array.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Thank you Guffa
|
|
|
|
|
Hi
How to start service in setup progress
i deploy a setup application for service
it's install but service don't start
i should manually start service
Finally
i would like to start service in installation progress(Amount Of Install)
Thanx
Boroumandan
|
|
|
|
|
Your are putting same question again and again !!! try to work arround the same question !!!
|
|
|
|
|
Hi it's my first post on this board, so "hello Everyone ".
I have a problem with new thread I need for my program. I must create new thread with socket parameter. On this page I found a way to pass a parameter. But this just not work for me.
This is some of my code program. It's lame so please don't mind.
This is a fragment of my new thread:
private static void Thread_Send_Recv(Socket w)<br />
{<br />
klient k = new klient();<br />
string dane;<br />
byte[] buf = new byte[255];<br />
while (true)<br />
{<br />
try<br />
{<br />
w.Receive(buf);<br />
dane = Encoding.UTF8.GetString(buf);<br />
string[] split = dane.Split(new Char[] { ',' });<br />
<br />
if (split[0].ToString() == "LOGIN")<br />
{<br />
string n, message;<br />
bool all_ok = true;<br />
byte[] m = new byte[255];<br />
<br />
n = split[1].ToString();<br />
<br />
...
And this is thread that invoke previous thread:
private static void Thread_Accept()<br />
{<br />
while (true)<br />
{<br />
s1 = s.Accept(); <br />
sockety.Add(s1);<br />
Console.WriteLine("Wykryto polaczenia z adresem: " + s1.RemoteEndPoint);<br />
ParameterizedThreadStart pts = new ParameterizedThreadStart(Thread_Send_Recv);<br />
Thread sr = new Thread(pts);<br />
sr.Start(s1);<br />
}<br />
}
When I try to compile this I get a strange error:
No overload for 'Thread_Send_Recv' matches delegate 'System.Threading.ParameterizedThreadStart
Why is that? I know that Socket isn't exactly a Object in parameters of Thread_Send_Recv but when I change it for an Object, it says that object don't have such methods as Recive(), Send(), etc. How to change it so it can work. Sorry for my bad English;P.
Thanks in advance for any word of help
|
|
|
|
|
You need to change the parameter's type to Object, like you describe. This is the "signature" of the ParameterizedThreadStart delegate, so you can't change this.
Now, since your parameter is now of type Object (and not Socket) then it does not have the methods/properites of the Socket type. Since you know that you passed in an object of type Socket (which is currently being held in a parameter of type Object), you can simply cast it to the appropriate type. So something like this:
private static void Thread_Send_Recv(Object obj)
{
Socket w = obj as Socket;
if (null == w)
throw new ArgumentException(...);
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Great, it works!
Thanks very much!!
|
|
|
|
|
I have a bunch of strings representing time spans, typical values being "6.0 months" and "3.0 years". Is there a way I can convert these into TimeSpan values so I can sort them correctly?
TimeSpan.Parse() is not quite what I want. Is there some other method in the framework or a third party library (I STFWed) or do I have to write my own?
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
Sorry mate, but you're going to have to write your own converter for them.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I feared as much and have rolled out half the code. I don't really look forward to doing the rest of it tomorrow.
Cheers,
विक्रम
And sleep will come, it comes to us all
And some will fade and some will fall
|
|
|
|
|
Hi Guys. I have managed to get some code to export data in my Access DB to a CSV file. Now, I have two small issues.
1. I want to mark all the records as they are exported to Y in a column named exported and only export all the records marked as N. Anybody have a suggestion on how I could do this in the export code?
2. When I open the CSV file in Excel I get a few errors. First error says that the file is in a different format than the one specified by the extention. It allows you to continue and then comes up with error "Cannot read the 1st record. The it reports yet another error which says that Excel has determined the file to be a SYLK file but not load it" but it still imports the data into Excel. Any ideas on how I get past this?
Code below:
private void toolStripButton2_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(@"C:\nefz.csv", false);
DataTable dt = m_dtCallCentre;
int iColCount = dt.Columns.Count;
for (int i = 0; i < iColCount; i++)
{
sw.Write(dt.Columns[i]);
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
foreach (DataRow dr in dt.Rows)
{
for (int i = 0; i < iColCount; i++)
{
if (!Convert.IsDBNull(dr[i]))
{
sw.Write(dr[i].ToString());
}
if (i < iColCount - 1)
{
sw.Write(";");
}
}
sw.Write(sw.NewLine);
}
sw.Close();
}
I was advised earlier by oneof the guys to go into the DB and run the export from there. This would defeat the pupose of writing code I think so if anybody else can help me out with this then I would greatly appreciate it.
|
|
|
|
|
Is it not the case with respect to 2 that Excel is expecting a comma separated file, but you are using semicolons to delimit the fields?
Regards,
Rob Philpott.
|
|
|
|
|
No mate. In both instances it gives me the same error. Whether I use commas or semicolons it comes up with the same error.
|
|
|
|
|
Hi
How to start service in setup progress
i deploy a setup for service
it's install but service don't start
i should manually start service
finnaly
i would like to start service in installation progress
Thanx
Boroumandan
|
|
|
|
|
Check your last post answer. i have already send it
Check it[^]
|
|
|
|
|
Hi Abhijit Jana
This code Shoud run in application
but i would like that
My Service Start In Setup progress
Note : in setup progress application dosn't start
|
|
|
|
|
r u buid the setup project using .net setup project section !!! then i think it's some diffcult .
but if u can write on your setup program and use that code !!!!
|
|
|
|
|
Hello Everyone,
I'm facing a very different problem.
In my application which is a windows service I need to copy some files from shared network drive which is already mapped for my windows user profile,to local folder.While doing so it gives me an error"Cannot find part of path" but if the same file copy code is used in a simple windows application it works fine and downloads the file.Can anyone help me solve this,can anyone tell me what i have failed to include for a windows service.
Amit
|
|
|
|