|
prdshukla wrote:
you gave a -ive vote...
How do you know it was him? It could have been anybody.
|
|
|
|
|
yeah..you are right...but may be by mistake he may have done it..
The rating process is not very intuitive...
|
|
|
|
|
How can Good Answer, Bad Answer not be intuitive? It's hard to see how it could be any easier.
BTW - it looks like it was two people who didn't like your answer.
|
|
|
|
|
You may have received the 1s because he says it's an EXE, not a DLL.
|
|
|
|
|
Perhaps this[^] might be of use? (At least the concepts involved might be what you want.)
|
|
|
|
|
<DllImport("E:\Temp\simple.dll", CallingConvention:="CallingConvention.Cdecl)"> _
Private Shared Sub ReturnInParam(ByRef Stan As Integer, _
ByRef Message As String)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim Num As Integer = 8
Dim Message As String = "Harun"
ReturnInParam(Num, Message)
MessageBox.Show(Message)
End Sub
|
|
|
|
|
 You can run the exe in the shell, but I'm not sure about the cmd window. I didnt need it, but thi scode will scrape the hidden cmd box for the shel output, in whichyou can regex the return values.
Private Function Shell_Exceute_FLV(ByVal Parameters_FFMpeg As String) As String
Dim Context As HttpContext = HttpContext.Current
Dim SB_FFMpeg As StringBuilder = New StringBuilder
Try
Dim Results As String = Nothing
Dim ffmpeg As New Process()
Dim ffmpeg_StartInfo As New ProcessStartInfo(Path_FFMPEG, Parameters_FFMpeg)
ffmpeg_StartInfo.UseShellExecute = False
ffmpeg_StartInfo.RedirectStandardError = True
ffmpeg_StartInfo.RedirectStandardOutput = True
ffmpeg.StartInfo = ffmpeg_StartInfo
ffmpeg.Start()
Dim ffmpeg_StreamReader As IO.StreamReader = ffmpeg.StandardError
SB_FFMpeg = New StringBuilder()
SB_FFMpeg.Append(ffmpeg_StreamReader.ReadToEnd().ToString())
Do While Not ffmpeg.WaitForExit(1000)
SB_FFMpeg.Append(ffmpeg_StreamReader.ReadToEnd().ToString())
Loop
If ffmpeg.ExitCode = 0 Then
ffmpeg.Close()
If Not ffmpeg_StreamReader Is Nothing Then
ffmpeg_StreamReader.Close()
End If
Else
ffmpeg.Close()
If Not ffmpeg_StreamReader Is Nothing Then
ffmpeg_StreamReader.Close()
End If
End If
ffmpeg.Close()
ffmpeg.Dispose()
ffmpeg = Nothing
Catch ex As Exception
End Try
Return SB_FFMpeg.ToString
End Function
|
|
|
|
|
hi every body!
I'm using Enterprise Library caching (memory caching) in my project. every thing works OK but when the application starts up for the first time I have a none ignorable delay! I can not understand the reason
every suggestion would be appreciated 
|
|
|
|
|
Caches take time to fill up, to overcome this fill your cache on a separate thread.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|
You should define priority of the data and load only the most important data while starting the App\service and put rest of the data load process on a background worker thread.
And it would be better if you do caching on server side rather than on client side. In case if it's really required to have a client caching, try using a different alternate something like SQL compact DB which could be shipped with the release binary rather than getting loaded each time when the App is launched.
Hope it helps.
|
|
|
|
|
Hi all again,
I'm focussing on the problem of persistence encapsulation with ADO.NET EF. AFAIK Entity Data Model (EDM) is another layer contains entities and associations... but where persistence is in fact encapsulated? If I work with POCO is correct to argue that persistence (and data access) is obtained in the ObjectContext where an EntitySQL or a LINQ to entities query will return an EntityObject?
I'm basing this assumption on this table[^]
Thanks
Ste
Ste
|
|
|
|
|
How to Forward Email by programattically?
Thanks
Alok Kumar Sharma
|
|
|
|
|
|
I made a change to an XML schema on a website; the file is located in App_Data/Schemas . It was the first of eight that the site uses, and the change involved adding a new element.
Now, opening any source file on the site results in a warning: Errors occured while compiling the Xml schemas in the project. Because of this, Xml intellisense is not available. There is no line or column number in the warning, and as far as I can tell, Intellisense on the linked XML files works just fine.
The weird thing is, I deleted the schema and restarted VS. Now I get the same warning on the schema that is now at the top of the list. I created a new, empty schema using the Add New wizard, gave it a name that put it at the top of the list, and now it is throwing the warning. I deleted that text and manually typed in the deleted schema, renamed the file and saved it, and it is still throwing the warning.
This is ridiculous.
It would seem that the compiler itself is bugged. How can I go about getting rid of this warning, without having to turn off display of all warnings?
|
|
|
|
|
I've been getting the same error for a few weeks now (although using VS2010). I haven't been able to track it down, and the error just opens the schema, but doesn't highlight any errors. Nothing is actually failing, and at this point (until something actually does fail), I'm chalking it up to a mystery bug somewhere in the IDE.
Shocking, I know. I'll bet that somehow, next time VS updates, it just as mysteriously disappears. 
|
|
|
|
|
During batch job processing i found lots of Deadlock occurance in logfile. Is it code issue or Database setting issue. I have 2-thread two-core CPU.
I am running this batch with 2-threads and maximum batch-size=1000.
In database setting for initrans=5 and maxtrans=250.
It causes when I run batch process with hundreds of thousands records. Please help me here.
LogFile error
General Level="High" Type="Custom" Severity="Notice" TimeStamp="2011-08-30 09:54:45" Message="WD: FAILED: An exception was caught during the execution of an action query: ORA-00060: deadlock detected while waiting for resource
. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---
|
|
|
|
|
The deadlock occurs when two or more sessions wait for the locks that are held by the opposite session. For more info,: http://www.oracle-base.com/articles/misc/Deadlocks.php[^].
Deadlock is a code issue. The best way to avoid deadlock is to make the changes to the tables always in the same order.
If you run a batch modifications, one possibility could be to lock the entire table before the batch starts. However the downside is that no-one can make modifications to this table while your batch is running.
|
|
|
|
|
Dimpal170 wrote: I am running this batch with 2-threads and maximum batch-size=1000.
In database setting for initrans=5 and maxtrans=250.
It causes when I run batch process with hundreds of thousands records. Please help me here.
Presumably what you mean is the following.
You need to process (insert/update) hundreds of thousands of records.
You are batching with a maximum of 1000 updates/inserts in one batch (where 1000 is a chunk of the total amount of processing to be done.)
You are using two threads each of which does its own batch (1000 at a time.)
If you are not doing that then please explain what it is that you are doing.
Are you processing data while doing the batch or doing nothing but the SQL?
Have you considered using the database import tool?
|
|
|
|
|
My XAML for the viewer window looks something like this:
<Window>
<DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
<Button Width="100" Height="25" Click="Save_Click">Save</Button>
</StackPanel>
<FlowDocumentScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto">
<FlowDocument x:Name="flowDoc" Background="White" PagePadding="5">
<BlockUIContainer>
<!--
</BlockUIContainer>
</FlowDocument>
</FlowDocumentScrollViewer>
</DockPanel>
</Window>
The Save_Click handler looks like this:
private void Save_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = "xps";
dialog.Filter = "XPS Document (*.xps)|*.xps";
dialog.OverwritePrompt = true;
if (dialog.ShowDialog() == true)
{
using (Package package = Package.Open(dialog.FileName, FileMode.Create, FileAccess.ReadWrite))
{
using (XpsDocument xpsDoc = new XpsDocument(package, CompressionOption.Maximum))
{
XpsSerializationManager rsm = new XpsSerializationManager(new XpsPackagingPolicy(xpsDoc), false);
DocumentPaginator paginator = ((IDocumentPaginatorSource)flowDoc).DocumentPaginator;
rsm.SaveAsXaml(paginator);
rsm.Commit();
}
}
}
}
Now when I click the "Save" button and enter a file name. The document is saved to a XPS file and all is good. HOWEVER, the FlowDocumentScrollViewer goes completely blank once the file is written to disk.
Is there any way to prevent this behaviour? I've tried some code to clone the FlowDocument via the use of TextRange etc. But the problem with this approach is that the UI elements isnt included in the cloned document, only regular text elements.
|
|
|
|
|
|
Hello,
I have an Serializable object "System configuration" when my application starts up i am preforming deserialization from XML file to an "System configuration" object and its works fine.
But when i try to serialize the object to the XML file i get the
next Exception:
"There was an error generating "the XML document"
Inner Exception message:
"A circular reference was detected while serializing an object of type Byte description"
System configuration object has a byte description oibject.
Any one has an idea what is the problem?
Thanks in advance...
|
|
|
|
|
One thing I can think of is if a child object holds a reference to its parent object, that represents a circular reference. It can't serialize such things because it would lead to infinite recursion.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
you need to show some code for a better answer
anyway, here's how to serialize xml
class myClass(){}
void SerializeToXML(myClass object)
{
XmlSerializer serializer = new XmlSerializer(typeof(myClass));
TextWriter textWriter = new StreamWriter();
serializer.Serialize(textWriter, object);
textWriter.Close();
}
As you saw in your app, the XMLSerializer also doesn't support circular references. If you need this kind of flexibility, you should consider binary serialization.
Here's how you can serialize to binary
void SerializeToBinary(myClass object, MemoryStream stream)
{
stream.Seek(0, System.IO.SeekOrigin.Begin);
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, object);
}
Use XmlTextWriter to manually create an XML file, and use XmlTextWriter.WriteBase64 to write your binary data into the file. Make sure you add a "length" attribute.
here's how to deserialize the binary back into an object
First make an XmlTextReader, navigate to the Element you wrote and create a MemoryStream
then create a byte[array] and put the data in it
xr.MoveToAttribute("length");
xr.ReadAttributeValue();
int length = Int32.Parse(xr.Value);
byte[] data = new byte[length];
xr.ReadBase64(data, 0, length);
stream.Write(data, 0, length);
now you can deserialize your object
stream.Seek(0, System.IO.SeekOrigin.Begin);
IFormatter formatter = new BinaryFormatter();
myClass object = (myClass)formatter.Deserialize(stream);
|
|
|
|
|
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.Data.OleDb.OleDbException: Could not find file 'D:\Documents and Settings\Raj Computer\Local Settings\Apps\2.0\8JC0578H.AN4\N27XQ98C.YR9\abcd..tion_6cdeed2b4dc164ad_0001.0000_dd2b28ab3a97d826\Database2.mdb'.
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
abcd
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Documents%20and%20Settings/Raj%20Computer/Local%20Settings/Apps/2.0/8JC0578H.AN4/N27XQ98C.YR9/abcd..tion_6cdeed2b4dc164ad_0001.0000_dd2b28ab3a97d826/abcd.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///D:/WINDOWS/assembly/GAC_32/System.Transactions/2.0.0.0__b77a5c561934e089/System.Transactions.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">
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.
|
|
|
|
|
Basically, it's telling you it can't find your database file, Database2.mdb.
Apparently you're using ClickOnce deployment and your connection string is eithwe wrong or your database file didn't get deployed with your app for some reason.
Read these[^] for some tips on resolving the issue.
|
|
|
|