|
Hi,
I am beginner, I want to convert My Database (MS Access) to XML files.
Anybody help me?
Pravin
|
|
|
|
|
Erhm, the easiest way is to load all tables in you database in a DataTable object and write that to XML using the WriteXml() method, however working with XML this way is pretty time consuming having large amounts of data in your database...
|
|
|
|
|
Hi,
I am new to Reflection. I have written the following code...
using System;
using System.Reflection;
using System.Security.Permissions;
namespace reflection
{
class Program
{
[STAThread]
static void Main(string[] args)
{
Assembly myassembly = Assembly.LoadFrom("ReflectionDLL.dll");
Type [] mytypes = myassembly.GetTypes();
foreach (Type type in mytypes)
{
Console.WriteLine(type.FullName);
}
}
}
}
and I am getting the following exception.
System.Security.SecurityException was unhandled
Message="Request for the permission of type 'System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Source="mscorlib"
GrantedSet="<permissionset class="\"System.Security.PermissionSet\"\r\nversion=\"1\"">\r\n<ipermission class="\"System.Security.Permissions.FileDialogPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nAccess=\"Open\"/">\r\n<ipermission class="\"System.Security.Permissions.IsolatedStorageFilePermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nAllowed=\"ApplicationIsolationByUser\"\r\nUserQuota=\"512000\"/">\r\n<ipermission class="\"System.Security.Permissions.SecurityPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nFlags=\"Execution\"/">\r\n<ipermission class="\"System.Security.Permissions.UIPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nWindow=\"SafeTopLevelWindows\"\r\nClipboard=\"OwnClipboard\"/">\r\n<ipermission class="\"System.Security.Permissions.UrlIdentityPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nUrl=\"file:///H:/dot" net="" practice="" projects="" reflection="" bin="" debug="" reflection.exe\"="">\r\n<ipermission class="\"System.Security.Permissions.ZoneIdentityPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nZone=\"Internet\"/">\r\n<ipermission class="\"System.Drawing.Printing.PrintingPermission," system.drawing,="" version="2.0.0.0," culture="neutral," publickeytoken="b03f5f7f11d50a3a\"\r\nversion=\"1\"\r\nLevel=\"SafePrinting\"/">\r\n\r\n"
PermissionState="<ipermission class="\"System.Security.Permissions.UIPermission," mscorlib,="" version="2.0.0.0," culture="neutral," publickeytoken="b77a5c561934e089\"\r\nversion=\"1\"\r\nUnrestricted=\"true\"/">\r\n"
RefusedSet=""
Url="file:///H:/dot net practice projects/reflection/reflection/bin/Debug/reflection.EXE"
StackTrace:
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
can anyone help me out plez...
|
|
|
|
|
no one knows the answer
|
|
|
|
|
Have you tried anything to resolve the issue or simply got the exception and posted it here?
It looks like you program is attempted to load an EXE. The exception is security related. What permsissions are set on the EXE? Does the security context the calling application is running under have the relevant permission on the target EXE to do what you are trying to do.
Actualy, what are you trying to do? You've just code dumped.
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
|
|
|
|
|
Hi!
MSDN has a quite extensive documentation about .NET security. This is definitively worth reading, otherwise you won't understand the answers you'll be given.
From your stack trace it seems as if the application is running from a network share. By default, CAS policies grant FullTrust only to applications running from the MyComputer zone, so either copy the files over to your local computer or adjust CAS policies accordingly.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
I'm a beginner, so please help me.
I want to know how to get value from other form variable or other form control, from our form. Thanx
Regard,
Edwin46
|
|
|
|
|
hi,
if u have one form as form1 and other as form2 and u want to show data from form1 to form2 then u can pass the values from form1 through the overloaded contructor of the form2.In form1 u could public properties to hold values for passing and then in the constructor pass these prop vals.I hope its clear.
|
|
|
|
|
Thanx a lot
regard
Edwin46
|
|
|
|
|
To get the value of a variable "V" in form "X" from form "Y", expose V as a public property in X, store a reference to an instance of X in Y, and access it. For example:
public class X : Form
{
public int V {
get { return v; }
}
int v = 0;
...
}
public class Y : Form
{
X x;
void someMethod()
{
int valueOfVinFormX = x.V;
}
} While this is probably the easiest way, it's not the recommended method of accessing data in other forms. But since you're a beginner, I decided to post a simple and direct answer.
/ravi
|
|
|
|
|
Thanx this is very helpfull
regard
Edwin46
|
|
|
|
|
you should try make a public class that returned a control u want to be call in another form
|
|
|
|
|
Can U give me an example, Please. Thanx a lot
regard
Edwin46
|
|
|
|
|
for example in form 1:
public DataGridView DataGridView1
{
get { return MyDataGridiew; }
}
and in form 2 you can call MyDataGridview
Hope it solve your problems
Regard,
TCim
|
|
|
|
|
Hi all,
I'm currently coding an enhancement to a drag & drop feature where it is now possible to invoke a second drag & drop mode. A colleague has suggested that it would be be aesthetically more pleasing if I use a different drag cursor when in the new mode. Some research has revealed that overriding the OnGiveFeedback function is the way to go; however on playing around with cursors and such I've encountered a problem for which I have not been able to locate a solution: the default cursor for a Move or Copy operation doesn't appear to be available from the places I would expect cursors to be (or perhaps I'm not looking in the right places...). Does anyone know where I can get it when I am in the gfbevent.UseDefaultCursors = false; state?
cheers!
|
|
|
|
|
Code snippet :
<br />
private void lstFilesOnDisc_GiveFeedback(object sender, GiveFeedbackEventArgs e)<br />
{<br />
e.UseDefaultCursors = false;<br />
if (e.Effect == DragDropEffects.Copy)<br />
{<br />
this.Cursor = curDragging;<br />
}<br />
else<br />
{<br />
this.Cursor = curNoDrop;<br />
}<br />
}<br />
|
|
|
|
|
Hi Eduard,
Thanks for your reply. It looks like curDragging is a custom cursor that was added to the project's resources. Is this correct?
I am trying to avoid using custom cursors if possible. It seems a little silly to me that I have to add a custom cursor for something which already comes with Windows/.NET!!
cheers!
|
|
|
|
|
Yep, in fact I use custom cursors which come from resources, however you can also use a cursor from the Cursors collection in .NET... The snippet is only meant to show you how to change the cursor while drag&dropping...
|
|
|
|
|
Thanks Eduard, but not quite what I was looking for. My question was probably a little vague...I was actually looking for the Drag-Copy icon rather then the way to change cursors.
I found the answer here: http://forums.microsoft.com/MSDN/showpost.aspx?postid=1868992&SiteID=1
cheers!
|
|
|
|
|
How can capture video from Webcam without audio? Because an error occured when I capture without audio. My project is capture preview and capture video from 2 Camera and more. Thank you.
|
|
|
|
|
Le Hoang Viet wrote: Because an error occured when I capture without audio.
What error?
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
Does "System.Drawing.Image" as same as "System.Net.Mime.MediaTypeNames.Image"?
Can using System.Drawing.Image in the ClassLibrary?
If it can how to do?
|
|
|
|
|
jason_mf wrote: Does "System.Drawing.Image" as same as "System.Net.Mime.MediaTypeNames.Image"?
No. System.Drawing.Image is an abstract base class that provides functionality for the Bitmap and Metafile descended classes. System.Net.Mime.MediaTypeNames.Image specifies the type of image data in an e-mail message attachment.
/ravi
|
|
|
|
|
hello for every one
i am writing a code in c# 2005 to open the serial port and then to read the data and finaly store the data in an array
my code as follows:
private void ReadPort_Click(object sender, EventArgs e)<br />
{<br />
port.Open();<br />
textBox1.Text = Convert.ToString(port.ReadLine());<br />
}
but there is no output appears on the textbox , i tried ReadExisting , ReadByte etc... but nothing works
the second problem , when saving in the array , after i click the button of read the program stop working and the following message display (Input string was not in a correct format.)
my code :
data[i] = Convert.ToInt32(textBox1.Text);
(i) increased with timer.
thank you for your help
ahmad al-omar
|
|
|
|
|
Hope the article by mikepc Serial Communication[^] here in CP will help you.
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|