|
Member 3824736,
Wrong forum. You want ASP.NET
Regards,
Gareth.
|
|
|
|
|
|
Hi,
I want to know if there is any event to know if the print button on the report viewer toolbar is clicked. I want to do some database updations only if the report is printed.
The alternative is to not use the toolbar button and do the printing on some button click on the form. But i dont want to do that.
Please reply if anyone know anything abt this.
-Abhijeet
|
|
|
|
|
I am trying to generate mof file from mib file by calling cmd.exe from my .net application and then executing a command from CMD.exe for genearting mof file .please go through the following code
-----------------------------------------------
////sample code///
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.ComponentModel;
using System.IO;
namespace Console_sample
{
class Program
{
public void OpenWithArguments()
{
string dir = @"C:\WINDOWS\system32\wbem\snmp";
//Set the current directory.
Directory.SetCurrentDirectory( dir );
ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
Process p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
p = Process.Start(startInfo);
p.StandardInput.WriteLine(@"Echo on");
p.StandardInput.WriteLine(@"smi2smir /a RFC1213-MIB.mib ");
p.StandardInput.WriteLine(@"mofcomp RFC1213-MIB.mof ");
p.StandardInput.WriteLine(@"EXIT");
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
Console.Write(output);
p.Close();
Console.Read();
}
static void Main(string[] args)
{
Program myProcess = new Program();
myProcess.OpenWithArguments();
}
}
}
////code ends///
-------------------------------------------------
In this code the line p.StandardInput.WriteLine(@"smi2smir /a RFC1213-MIB.mib "); is not getting excuted .when i run this command smi2smir /a RFC1213-MIB.mib in command prompt it's getting excuted .even the next line of code is working fine .
can anyone tell how to fix this problem?Actually i am looking for WMI COM API for generating mof file from mib file but i didn't get it so i am trying to do it by another way .if anyone can give me API for following command in C# .net it will be very helpfull.
any help appreciated
Thanks in advance
|
|
|
|
|
Hi!
There is a DataTable, according to this table I need to do a simple column chart... I think I need to use a ReportViewer control but HOW???
MSDN article offer the next solving of this problem:
ReportViewer1.ProcessingMode = ProcessingMode.Local;
ReportViewer1.LocalReport.ReportPath = @"c:\Reports\Report1.rdl";
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Sales", LoadSalesData()));
ReportViewer1.LocalReport.Render(
"Excel", null, out mimeType, out encoding,
out extension,
out streamids, out warnings);
In result I get an empty ReportViewer1 ...
Please help!
|
|
|
|
|
Hi,
I am working on a project whereby I need to create a scale down version of a dom explorer. I am able to parse the html at this point. What I need to do now is as I select a node (eg ) it must hightlight the selected table element in the page viewer section, similar the firebug.
Any ideas where I can find some information on doing this?
Thanks
modified on Monday, May 19, 2008 11:43 PM
|
|
|
|
|
|
string sFilename = System.IO.Path.GetFileName(myFile.FileName);
string ans;
while (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename)))
{
Console.Write("Do you want to overwrite? (Yes/No)");
ans = Console.ReadLine();
Console.WriteLine("");
while (ans = Yes)
{
}
logic: check if image already existed when uploading, if yes, ask user for input yes/no, if yes overwrite, if no, change a new filename.
im lost.. plz help
|
|
|
|
|
This is about as lost as you can be.
1 - this is not the ASP.NET forum
2 - Why are you not using Path.Combine in your second step ?
3 - The console is not visible at all in a windows app, and it sure is not visible to an ASP.NET user.
I remember telling you all this before, I suggest you buy a basic ASP.NET book and read it before going further.
Oh, and a basic C# book, you have a constant string not in quotes from the look of it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Just to add, last time you ignored my responses, waited two days and asked again. It's obviously not getting any better, you obviously are totally lost. If you respond, perhaps I can help you, but the starting point is definately a beginners book. I sincerely hope this is just a fun project and not paid work at this point.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
heh i might missed the entry, sorry about that.
i know i'm not an expert but please at least if you're not gonna provide something constructive, then shut it. for sure a book may help but if thats the option i wouldn't post here lol.
|
|
|
|
|
Thomas Toh wrote: for sure a book may help but if thats the option i wouldn't post here lol.
Why is it not an option ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Why is it not an option ?
Answering your reply to his original post, so he must reply to his originaal post instead.
Michael Martin
Australia
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible."
- Mr.Prakash One Fine Saturday. 24/04/2004
|
|
|
|
|
Thomas Toh wrote: i know i'm not an expert but please at least if you're not gonna provide something constructive, then shut it
SPeaking like this to the guys that are trying to help you is never ever going to get you anywhere. CHristian has helped me numerous times. I suggest you leave the being "RUDE" issues from your posts and be nice!!
It is people like you who make it difficult for others like us.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Thomas Toh wrote: then shut it
Don't look a gift horse in the mouth, lest ye be retarded.
Thomas Toh wrote: for sure a book may help but if thats the option i wouldn't post here lol.
I don't know anything about C# (I'm a C/C++ programmer), and I noticed some of the stuff Christian mentioned right off the bat. What does that tell you? It means you're missing basic knowledge in regards to programming. Him recommending you to read a book to help cover the foundations is a favor dude.
|
|
|
|
|
ok i'll rephrase my question, i'm doing asp.net with c#. for this particular function, i need to use VB input box in c# to validate user input. i've read
http://www.mdibb.net/net/using_the_visual_basic_input_box_in_c/
but it doesnt seem to work as it says MessageBox.show does not exit in current context.
PS: christian, if you don't feel like answering is ok, no one is forcing you. and btw this forum doesn't state its not for beginners. if you have no patience teaching, then don't.
|
|
|
|
|
Thomas Toh wrote: i'm doing asp.net with c#.
Then you should probably use the ASP.NET forum. I told you that last time
Thomas Toh wrote: i need to use VB input box in c# to validate user input
Well, you really can't. This is why I'm telling you to buy a book, you're missing what ASP.NET *is*. The only thing you can run on the client side, is javascript.
Thomas Toh wrote: but it doesnt seem to work as it says MessageBox.show does not exit in current context.
Yes, it's trying to tell you what I've told you four times now.
Thomas Toh wrote: and btw this forum doesn't state its not for beginners.
I am always happy to help beginners. It's people who ignore advice and just ask the same things that frustrate me.
So - for the fifth time. ASP.NET means that you can't use the console, or the message box, or any other winforms or other client side construct to show a message to the end user. Your best bet, is to create a new filename on the server, or to create a new folder to put the same file in. Or, just store it in a DB, where the names can overlap, so long as there's some other way to identify them.
Why are you saving an image in the first place ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Are you sure?
*hides*
|
|
|
|
|
Hey I think you complicating the things much. There are out of the box validation controls avialable for the Asp.NET controls. Can you justify why you want to use VB controls ?.
Thomas Toh wrote: but it doesnt seem to work as it says MessageBox.show does not exit in current context.
MessageBox.Show works in win forms not in asp.net. To achieve the same you can use javascript.
And also forum is not only for throwing a instant answer for the moment, its also guides one to look further on the topics you posted.. So on that sense he told you to buy a book and its also a way of teaching too. Its worth to read a book on starting stage.
Regards,
Vythees
Miles to go before sleep...
|
|
|
|
|
His issue is, he doesn't know the file already exists until his postback has occured.
I've never seen anyone try to output a prompt in a website on the console before tho.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
ok finally thanks for ur constructive response......... so it's possible to use javascript on asp.net for that?
im doing a simple website that allows users to upload image (simply copy/paste image from other folders to my application/images folder). also additional functions.. one of them is to validate whether the image i'm going to upload already existed.. if yes, ask user for input yes/no, if yes overwrite, if no, change a new filename.
i downloaded the sourcecode from here
http://www.codeproject.com/KB/aspnet/netimageupload.aspx also from there modify. atm im stuck at this function... later i'll have to do a Search function on the webpage. that is to search via descriptions/properties of the image not just the filename and i'm not allowed to use DB for that (tho its quite easier right)?
|
|
|
|
|
If you actually replied to my posts instead of yours, I'd get an email, and the threading on the forums would make sense.
Thomas Toh wrote: so it's possible to use javascript on asp.net for that?
Kind of. You can show prompts using javascript. However, once you've done a postback, your chance for javascript validation is over, I'd just show a message saying the filename already exists in a control on the page, asking them to rename it and reupload. That is, if you need to do that, overall, I'd take one of the other approaches I suggested ( rename it, put it in a DB, etc )
Thomas Toh wrote: that is to search via descriptions/properties of the image not just the filename and i'm not allowed to use DB for that (tho its quite easier right)?
You're actually doing a paid project here ? Why can't you use a DB ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks but i don't quite understand your sentence
"However, once you've done a postback, your chance for javascript validation is over"
it's a school project.. no idea as teacher said DB is unnecessary..is there any other way? i've done a simple but not yet complete code lol...
if (System.IO.File.Exists(Server.MapPath(sSavePath + sFilename)))<br />
{<br />
Response.Write("<script type=\"text/javascript\">var result = confirm('Image already existed. Click OK to overwrite. Click NO for new filename.')</script>");<br />
<br />
<br />
}
|
|
|
|
|
Thomas Toh wrote: as i said i'm not allowed to use DB....
But why not ?
Thomas Toh wrote: Response.Write("var result = confirm('Image already existed. Click OK to overwrite. Click NO for new filename.')");
You're on the right track, but, your page will reload, then your file upload control is empty, and your message box pops up. You will need to do another postback, after the user selects the file again, to get anotehr shot at it. You could use AJAX, but even then, you can't access file paths from javascript. So, your only option as far as I can see, is to find a way to rename the files, or to store the files in folders so the names don't clash. For example, you could store it to a temp filename, store that name in the viewstate, then postback and ask for a new name or if you should overright, but you are better to ask that in the page, not with a popup.
Why can't you use a DB ? You're working on a photo site that needs to be searchable, but can't have a database ? For school, or for a client ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i'm not sure whether the teacher is dumb or what lol. personally i think DB is so much easier and i have no idea why she said it's unnecessary not needed.
well, i guess i'd have to follow your path lol.i rougly know your idea.. is there a website guide that you could show me so that I can follow the guide?
|
|
|
|