|
LIttle_Cat wrote: Who dealed with this plz give me advice - how to remove all data from table? I have not dealt with Hibernate; but then again, if it doesn't support cascading delete's, you can always delete them yourself. Either by executing an extra delete-statement, or by defining a trigger on the database-tables.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks for Your attention.
A little bit I understand the proccess but don't know how to solve the problem. I have table with field Id(external key), other two tables references to tjis table. While delete NHibernate kills one child and meets external key which is also must be deleted but can't be deleted because it is one another child. So the question is: how to do it by NHibernate without isage of separate removing? And why this problem does not raising while removing separate strings in parent table, only with cascade removing? The same is going with SQLite database
|
|
|
|
|
Hi,
I have RDLC report with a viewer on the form. It's working great on my development laptop.
but when I deployed the application to another machine (using InstallShield) I am getting the following error.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> System.ApplicationException: The report definition for report 'C:\Documents and Settings\USER\Desktop\invoice.rdlc' has not been specified ---> System.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\USER\Desktop\invoice.rdlc'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.ReportingServices.StandalonePreviewStore.GetReportDefinition(ReportID reportId)
at Microsoft.Reporting.PreviewStore.GetCompiledReport(CatalogItemContextBase context, Boolean rebuild, Byte[]& reportDefinition, ControlSnapshot& snapshot)
--- End of inner exception stack trace ---
at Microsoft.Reporting.PreviewStore.GetCompiledReport(CatalogItemContextBase context, Boolean rebuild, Byte[]& reportDefinition, ControlSnapshot& snapshot)
at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContextBase itemContext, Boolean rebuild, ControlSnapshot& snapshot)
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
--- End of inner exception stack trace ---
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
at cleaning_company_software.frmMain.print_invoice2(Int32 invoice_id) in C:\Users\Jassim\Documents\Visual Studio 2010\Projects\WipePro\WipePro\main_form.cs:line 840
at cleaning_company_software.frmMain.barButtonItem7_ItemClick(Object sender, ItemClickEventArgs e) in C:\Users\Jassim\Documents\Visual Studio 2010\Projects\WipePro\WipePro\main_form.cs:line 2596
at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarBaseButtonItem.OnClick(BarItemLink link)
at DevExpress.XtraBars.BarItemLink.OnLinkClick()
at DevExpress.XtraBars.BarItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.BarItemLink.OnLinkActionCore(BarLinkAction action, Object actionArgs)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.ClickLink(BarItemLink link)
at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
at DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WipePro
Assembly Version: 1.0.0.0
Win32 Version: 1.00
CodeBase: file:///C:/Program%20Files/WipePro/WipePro.exe
----------------------------------------
DevExpress.Utils.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.Utils.v11.1.DLL
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
DevExpress.Data.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.Data.v11.1.DLL
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
DevExpress.XtraEditors.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraEditors.v11.1.DLL
----------------------------------------
DevExpress.XtraGrid.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraGrid.v11.1.DLL
----------------------------------------
DevExpress.XtraNavBar.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraNavBar.v11.1.DLL
----------------------------------------
DevExpress.XtraBars.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraBars.v11.1.DLL
----------------------------------------
DevExpress.Printing.v11.1.Core
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.Printing.v11.1.Core.DLL
----------------------------------------
Microsoft.ReportViewer.WinForms
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.ReportViewer.WinForms/10.0.0.0__b03f5f7f11d50a3a/Microsoft.ReportViewer.WinForms.dll
----------------------------------------
DevExpress.XtraPrinting.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraPrinting.v11.1.DLL
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Microsoft.ReportViewer.Common
Assembly Version: 10.0.0.0
Win32 Version: 10.0.30319.1
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.ReportViewer.Common/10.0.0.0__b03f5f7f11d50a3a/Microsoft.ReportViewer.Common.dll
----------------------------------------
DevExpress.XtraTreeList.v11.1
Assembly Version: 11.1.4.0
Win32 Version: 11.1.4.0
CodeBase: file:///C:/Program%20Files/WipePro/DevExpress.XtraTreeList.v11.1.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
MySql.Data
Assembly Version: 6.6.4.0
Win32 Version: 6.6.4.0
CodeBase: file:///C:/Program%20Files/WipePro/MySql.Data.DLL
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
PasswordHash.NET
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/WipePro/PasswordHash.NET.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Technology News @ www.JassimRahma.com
|
|
|
|
|
Did you even read the exception message? Is telling you exactly what the problem is. This should give you a large clue as to what you should be looking at in your code.
|
|
|
|
|
How to draw a half pixel line in c#
Please help me
Thanks in Advance
|
|
|
|
|
While mathematically, and abstractly, you could model some fraction of a pixel, when it comes to "reality," a pixel is a fundamental atomic unit of a hardware display, or print/render, device which may be dependent (as in screen resolution/bit-depth) on software settings.
So, I am wondering what your goal is here. Are you wanting to model in floating point before you, ultimately, generate ints to affect some display or printed output ?
Please clarify.
If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya
|
|
|
|
|
I thought you knew that the Pixel is made of different numbers of the three types of Colorons and an Alpha particle?
Clearly, half a pixel would be no Alpha particles (which is good from a Health and Safety point of view), no Redulons, 127 Greons and 255 Bluons.
It's also not visible as a result...Dark Pictures!
|
|
|
|
|
The speed of your light is a constant
If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya
|
|
|
|
|
I take it what you are wanting to do is reduce an image size by 1/2?
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I want to draw half pixel size line
|
|
|
|
|
The smallest line you can draw is one pixel wide; there is nothing smaller.
Veni, vidi, abiit domum
|
|
|
|
|
The concept of half a pixel is like the concept of half an atom - the idea itself does not make sense.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I want to deserialize a dictionary with datacontractserializer, the xml schema is the following :
<General xmlns="http://schemas.datacontract.org/2004/07/MyProject" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Mydictionary xmlns:a="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<a:KeyValueOfunsignedByteMyclass>
<a:Key>1</a:Key>
<a:Value>
....
</a:Value>
</a:KeyValueOfunsignedByteMyclass>
<a:KeyValueOfunsignedByteMyclass>
<a:Key>2</a:Key>
<a:Value>
....
</a:Value>
</a:KeyValueOfunsignedByteMyclass>
</Mydictionary>
But on deserializing, I get this error :
"An item with the same key has already been added."
(referencing KeyValueOfunsignedByteMyclass)
Can someone help me to resolve this problem please?
Thanks
|
|
|
|
|
I think you could get more helpful responses here if you posted the same code you posted on the same question on StackOverFlow: [^] ... where you show your code for the 'xml_todata method which does the deserilization.
And, if you do that post that code, which doesn't compile as shown, people here are going to ask you the same questions the SO folks asked you, so: please post code that will compile and in which you show us the declaration of the variable 'deserializ.
It also might be very useful if you show how you applied the DataContractAttribute and DataMemberAttribute Attributes to the Dictionary you serialized.
If you seek to aid everyone that suffers in the galaxy, you will only weaken yourself … and weaken them. It is the internal struggles, when fought and won on their own, that yield the strongest rewards… If you care for others, then dispense with pity and sacrifice and recognize the value in letting them fight their own battles." Darth Traya
|
|
|
|
|
I am using AviFile api to make a screen capture video. I want to capture it as small videos of 2 minutes length instead of creating one single video at a stretch. When the video starts getting recorded, a pop-up box to chose the compression option is displayed by default when the avisaveoptions function is called. This creates a problem since I have to choose the option every 2 mins. I would like to avoid this by setting the default value to 'Microsoft Video 1'. How can I do this?
thanks in advance
|
|
|
|
|
Hello
I use this code
AviManager aviManager =new AviManager(@"new.avi", false);
//add a new video stream and one frame to the new file
VideoStream aviStream =aviManager.AddVideoStream(true, 2, bitmap);//(dlg,Rate, bmp);
how I can choice compression method without show dialog, I want microsoft video 1 compression method.
thanks.
|
|
|
|
|
I am using a tool that generates SQL table scripts.
How can I run the scripts from within a C# app?
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
Just a plain .sql script file? You just need to read the file into a string and execute that string as a command. The only potential issue is if the file contains a batch delimiter such as GO , in which case you need to execute each batch separately.
private static IEnumerable<string> ReadCommandBatches(IEnumerable<string> lines)
{
var builder = new StringBuilder();
forach (string line in lines)
{
if (string.Equals(line, "GO", StringComparison.OrdinalIgnoreCase))
{
if (builder.Length != 0)
{
yield return builder.ToString();
builder = new StringBuilder();
}
}
else
{
builder.AppendLine(line);
}
}
if (builder.Length != 0)
{
yield return builder.ToString();
}
}
public static void ExecuteScriptFile(SqlTransaction transaction, string filePath)
{
var lines = File.ReadLines(filePath);
foreach (string batch in ReadCommandBatches(lines))
{
using (var command = new SqlCommand(batch, transaction.Connection, transaction))
{
command.ExecuteNonQuery();
}
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you sir!
If it's not broken, fix it until it is
|
|
|
|
|
Read it in as a string and pass it to the command, if you pass it as a whole I think you don´t need to bother about anything.
Make sure to catch any thrown exeptions from the result though.
|
|
|
|
|
Hi
I have a dataset from the stockmarket. It's intraday data so there are many inputs for each date.
I am trying to create only one row of daily data for each new day, so I need to find the range for each date, then get some values from this.
If you're familiar with stockmarkets, basically I have intraday-data and need to build a new .txt file (or .csv) with end-of-day data.
I know how to do this in VBA, but it would take a couple of weeks to get the work done...
If anyone would care to help me I would appreciate it.
Here's an example on how my .txt data look:
1/3/2012,09:30:00,409.3,410,409,409.79,657901
1/3/2012,09:35:00,409.79,411.5,409.72,411.29,493743
1/3/2012,09:40:00,411.3,411.68,410.63,410.86,335420
1/3/2012,09:45:00,410.84,411.47,410.71,411.28,212007
1/3/2012,09:50:00,411.28,411.5,410.85,411,206154
1/3/2012,09:55:00,411,411.3,410.92,411.3,141447
1/3/2012,10:00:00,411.3,411.75,411.11,411.65,230247
1/3/2012,10:05:00,411.65,412,411.58,411.86,200034
1/3/2012,10:10:00,411.89,412.2,411.57,411.76,221007
1/3/2012,10:15:00,411.79,412.2,411.78,412.1,111159
1/3/2012,10:20:00,412.1,412.41,412.08,412.4,117193
1/3/2012,10:25:00,412.37,412.5,411.93,412.22,147114
1/3/2012,10:30:00,412.22,412.38,411.9,412.03,91461
1/3/2012,10:35:00,412,412.08,411.8,411.92,123093
1/3/2012,10:40:00,411.9,411.98,411.1,411.17,145873
1/3/2012,10:45:00,411.17,411.33,410.56,410.68,195539
1/3/2012,10:50:00,410.66,410.86,410.22,410.75,203342
I'm not experienced in C#, so I need pretty detailed information I think
Kind regards
Espen
|
|
|
|
|
|
Ok, thanks for the link. I'll check it out right away and see if I can understand it.
Kind regards
Espen
|
|
|
|
|
lordoftrades wrote: so I need pretty detailed information I think
So do we! How should we know how to help you, if you can't even describe what kind of data consolidation should be done.
Since it is comma separated you can start by reading the file line by line and splitting it into pieces using String.Split .
Then you'd parse the first column (date) with DateTime.Parse[^] ignore the second column (time)
and parse the rest of the columns using Double.Parse[^].
If it is the first line or the date hasn't changed yet do your data consolidation calculations.
If the date changed write out the last consolidated data and reinitialise the data consolidation with the values for the new date.
Rinse, lather, repeat!
Regards,
— Manfred
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
Yes you are right. Sorry. I need to get the following data:
For each date I need value from the
first row third column (or [2])
higest value from the fourth column
lowest value from fifth column
finally value from the last row sixth column.
This should all be written to new file adding the date to first column [0], and thereafter the data in same order as above.
I see your point on this:
Quote: If the date changed write out the last consolidated data and reinitialise the data consolidation with the values for the new date.
Not sure though, how to write it out.
Kind regards
Espen
|
|
|
|
|