|
spif2001 wrote: I'm confused at to why a direct use of the bat file works, when the call to the bat file from within C# fails!?
You could try setting the WorkingDirectory[^];
If the property is not set, the default working directory is %SYSTEMROOT%\system32.
I are Troll
|
|
|
|
|
Sorry sorry sorry... stupid me...
I didn't notice my projects in Visual Studio was set to x86. Setting them to Any CPU solved my problems.
I guess when run as x86, the System32 part of the path gets redirected to the SysWOW64 folder. In which of course the desired files are not placed.
I'm in the high-fidelity first class traveling set.
And I think I need a Lear jet.
|
|
|
|
|
spif2001 wrote: I didn't notice my projects in Visual Studio was set to x86. Setting them to Any CPU solved my problems
I would have overlooked that too
I are Troll
|
|
|
|
|
Hey all,
I am not sure whether this is possible and if I am approaching it the wrong way but...
What I'd like to do is have a form that allows 3 separate records from a database to be shown in text boxes similar to:
Record 1 Size Record 1 Rate | Record 2 Size Record 2 Rate | Record 3 Size Record 3 Rate |
Record 1 Total | Record 2 Total | Record 3 Total |
Could someone please push me in the right direction for achieving this? I have a query that returns either 1,2 or 3 records but can currently only get my form to display the same record in all 3 sets of text boxes.
Any help would be appreciated!
Joe
|
|
|
|
|
Without seeing any of your code, it's hard to advise you on how best to do this. Are you binding textboxes directly? Are you programatically binding them? How are you retrieving the data - is it via DataSet or DataReader?
|
|
|
|
|
Thanks for the reply Pete,
I am fairly new to this whole thing - but am slowly getting my head around it.
I'm retrieving the data via DataSet, with the text boxes bound to the dataset(however I have not bound them myself, just dragged and dropped in the designer).
Currently the query I have is a simple designer one with 2 parameters for if ID = @ID1 or if ID = @ID2.
Joe
|
|
|
|
|
i add data set &
add 4 table in this data set and design 4 reports for each table
i want to choose the report & set datasource to report and show in microsoft report view
i try this code but failed
ReportOfEng.LocalReport.ReportEmbeddedResource = "follow_up.Report1.rdlc";
ReportDataSource ds = new ReportDataSource();
ds.Name = dataSet11.Movements.TableName;
ds.Value = dataSet11.Movements;
ReportOfEng.LocalReport.DataSources.Clear();
ReportOfEng.LocalReport.DataSources.Add(ds);
this.movementsTableAdapter1.Fill(dataSet11.Movements);
this.ReportOfEng.RefreshReport();
then in runtime when i btnclick
this message appear in report
"data source instance has not been supplied for dataset"
so what i can do
|
|
|
|
|
Well, LocalReport.DataSources has been cleared, and yet you haven't done a LocalReport.DataSources.Add .
|
|
|
|
|
i add the datasource in program but i forget to add in this block code
so the error appear in the report
so again what can i do
|
|
|
|
|
depend on RadioButton Check
if (rdbEng.Checked==true)
{
ReportsOfRun.Reset();
ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow_up.Report_Eng.rdlc";
ds.Name = "DataSetReport_Eng_Table";
ds.Value = Eng_TableBindingSource;
ReportsOfRun.LocalReport.DataSources.Add(ds);
ReportsOfRun.DocumentMapCollapsed = true;
this.Eng_TableTableAdapter.Fill(this.DataSetReport.Eng_Table,int.Parse(txtEngCode.Text));
}
else if (rdbMonth.Checked==true)
{
ReportsOfRun.Reset();
ReportsOfRun.LocalReport.ReportEmbeddedResource = "follow_up.Report_Month.rdlc";
ds.Name = "DataSetReport_Month_Table";
ds.Value = Month_TableBindingSource;
ReportsOfRun.LocalReport.DataSources.Add(ds);
ReportsOfRun.DocumentMapCollapsed = true;
this.Month_TableTableAdapter.Fill(this.DataSetReport.Month_Table, txtMonth.Text);
}
thanx to how try to help me
|
|
|
|
|
Well done, and well done for showing your solution. That's a bit of class that is.
|
|
|
|
|
i call this method by button and this exception appeare
exception "Backup failed for Server"
public void BackupDatabase(String databaseName, String destinationPath)
{
Backup sqlBackup = new Backup();
sqlBackup.Action = BackupActionType.Database;
sqlBackup.BackupSetDescription = "FollowUPBackUP:" + DateTime.Now.ToShortDateString();
sqlBackup.BackupSetName = "FollowUP";
sqlBackup.Database = databaseName;
BackupDeviceItem deviceItem = new BackupDeviceItem(destinationPath, DeviceType.File);
string instantname = @".\sqlexpress";
ServerConnection connection = new ServerConnection(instantname);
Server sqlServer = new Server(connection);
Database db = sqlServer.Databases[databaseName];
sqlBackup.Initialize = true;
sqlBackup.Checksum = true;
sqlBackup.ContinueAfterError = true;
sqlBackup.Devices.Add(deviceItem);
sqlBackup.Incremental = false;
sqlBackup.ExpirationDate = DateTime.Now.AddDays(10);
sqlBackup.LogTruncation = BackupTruncateLogType.Truncate;
sqlBackup.FormatMedia = false;
sqlBackup.SqlBackup(sqlServer);
}
modified on Wednesday, December 1, 2010 1:17 AM
|
|
|
|
|
I'm pretty sure that the error message was longer than just "Backup failed for Server". If it was then it might help people, to help you, if you edited your question to include the full message.
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 would you want to do this?
|
|
|
|
|
Hi Pete,
Are you able to help?
I'm having a problem with remote desktop logging off the local machine when the remote session is ended. Even if this is only a temporary work around until I figure out why this is happening with vista and not xp, I would like to implement it immediately.
|
|
|
|
|
I've used a version of this code in the past, and it works fine. What problem are you having with it?
|
|
|
|
|
It won't compile and there are duplicate code entries as well as some other things I had to do to get it to compile.
I have something that compiled and did work as far as stopping me from logging off when I'm in front of the machine, but it still doesn't seem to block the machine from logging off when the remote desktop session is disconnected.
|
|
|
|
|
I'm not aware of anything that will prevent this happening when the remote desktop session disconnected.
|
|
|
|
|
Somehow it isn't an issue when I take an XP machine and remote desktop into a Vista machine. The session is saved when the XP machine is disconnected, etc.
When it is vista to vista, the problems start occurring. There has to be a way to emulate what is happening with XP.
|
|
|
|
|
I'm sorry that I can't help you. I'll be watching this with a lot of interest. I hope you get it resolved soon.
|
|
|
|
|
Thanks!
This worked last night, I'll continue to test it throughout the week. I wrapped it in a c# application that blocks logging off without verification first. The same can be done for XP, but the first command is a bit different, it is " tscon 0 /dest:console " instead.
I through the wait commands in, because a few times that I was testing it would release the session before the lock command could run and then it would not lock the machine, so an unlocked desktop was left sitting at the office, not something I wanted to happen. Thanks for the help and encouragement Pete.
tscon.exe RDP-Tcp#0 /dest:console
wait 1
rundll32.exe user32.dll, LockWorkStation
wait 1
exit
|
|
|
|
|
|
How could one reboot a local computer to safe mode using C#?
I have used google to search for this and not finding much. I did find a question posted for the exact same thing here on codeproject from '06 but the reply the guy got was this was not possible.
I see this for shutting down or rebooting:
http://pinvoke.net/default.aspx/wtsapi32/WTSShutdownSystem.html[^]
Before you say this cannot be done, I currently use a Windows application that can reboot a computer to safe mode. Not sure how they do it, but they are somehow.
|
|
|
|
|
I have never tried this but your question intrigued me so I did a little googling.
If the OS on the computer is XP or before how about temporarily editing Boot.ini to add a /SAFEBOOT switch (source[^]), with a runonce registry entry to reset afterwards.
I'm not sure how Vista and Weven work but a similar technique might be possible.
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.”
|
|
|
|