|
Sorry, can't help you there; I have been using both Access and SQLServer, but always migrating away from Access, never creating one.
|
|
|
|
|
Using Interop you should be able to do this. That assumes you know how to create databases, tables etc using Access objects. You might be able to do it running SQL queries in Access - again assuming you know the required SQL. You can pick up some of it in the Access designer for queries - just create a make table one then switch to SQL view.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Here is my suggestion. IF you have a copy of access, use it create the tables and views that you need. After doing that, you can write your C# application to use the Access database. I think you will find it a lot easier to create the database within MS Access that try to create it using C#.
|
|
|
|
|
Hi all,
I have created setup for my program . This setup creates shortcut icon on my desktop. But this icon have wrong target set. Target shown is 'MyInstaller' ( where 'MyInstaller' is deployment project name ). When I check other shortcuts available on my desktop, I found Target is set to '"C:\Program Files\Beyond Compare 3\BCompare.exe"' (for example). Why all the shortcuts created by me do not have such target? I wanted to use the target to process my documents.
Do I miss some settings here?
Thanks in advance !!
Amit
|
|
|
|
|
Show the code you use to create the shortcut, there is probably something wrong in it.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi Richard,
Thanks for the reply.
I haven't write any code for this. I followed below steps 1) add 'Setup Project' to the solution. 2) right click on Project, select 'View' => 'file system' 3) add 'primary output' to the Application Folder 4) create shortcut by right clicking on the primary output file 5) move this shortcut to the 'User's Desktop' folder Any idea how this can be handled?
Amit
|
|
|
|
|
Sorry, I have not used this process so cannot offer any suggestions, other than to suggest you check carefully that each step is referring to the correct object.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
ok...do you have any example of 'using Installer class' for deploying windows projects? or any other way for installation process?
Amit
|
|
|
|
|
iamdking wrote: do you have any example
I'm afraid not, that's why I said "cannot offer any suggestions". However, you could try a Google search for 'using Installer class' and see what that comes up with.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi Richard,
Thanks for reply. I got help from this url [^]. My app is working now..
Amit
|
|
|
|
|
Hi everyboody
I tried DirectX.Capture modified can be archived into a wmv, but I do not know how to share?
|
|
|
|
|
I have these 5 method objects. These 5 method objects have exactly same function calls. Example as below:
int method = 3;
int result = 0;
Method1 m1 = new Method1();
Method2 m2 = new Method2();
Method3 m3 = new Method3();
Method4 m4 = new Method4();
Method5 m5 = new Method5();
switch (method)
{
case 1: m1.SolveThis(ref int result); break;
case 2: m2.SolveThis(ref int result); break;
case 3: m3.SolveThis(ref int result); break;
case 4: m4.SolveThis(ref int result); break;
case 5: m5.SolveThis(ref int result); break;
}
(inside each m* contains different methods, for the sake of arugment).
Is it possible to do this as below?
Object mm;
int method = 3;
int result = 0;
switch (method)
{
case 1: mm = new Method1; break;
case 2: mm = new Method2; break;
case 3: mm = new Method3; break;
case 4: mm = new Method4; break;
case 5: mm = new Method5; break;
}
mm.SolveThis(ref int result); // this line doesn't see "SolveThis" funtion in .NET.
Anyone have any thoughts?
|
|
|
|
|
Blubbo wrote: Anyone have any thoughts?
Yes. A head full.
1. What you probably want is called an interface . Have all these MethodX classes implement a common interface which is a promise to implement whatever you like, such as a void SolveThis(ref int) method.
2. Please use PRE tags when posting code (or tabular data). It improved readability.
3. Your choice of names is horrible. A method is a method, a class is a class; don't define a class called MethodX. SolveThis is another poor choice, "this" has a special meaning in object-oriented languages such as C#.
4. Why is it your SolveThis method using a ref parameter, and apparently not using any return value?
5. If you're new to C# (or to programming in whatever language) I strongly recommend you choose, buy and study a book (a real book, one you own) and acquire good practices from day one; it is the easiest and fastest way to make real progress.
|
|
|
|
|
1) I haven't used interface in my code before... the next responder by RobCroll has suggested a good solution for my question.
2) Yes, I am aware of PRE tags but apparently forgot to include that in my initial posting. My bad!
3) I was having hard time on what to say to give the reader the example without revealing important codes in my source (its work related).
4) I use int return value to provide the error code in case the function call failed to process. that's why I use ref parameter.
5) I am not new to C#. I have few books here and also online resources to help me out... I am still working on improving the efficiency of my codes.
|
|
|
|
|
Blubbo wrote: I have few books here
Every book on C# is bound to discuss interfaces, so my best advice is to read one of those books you have from cover to cover and you will learn some of the basics you seem to be lacking right now. Browsing some on-line material is no substitute, it is a handy addition.
|
|
|
|
|
Create an interface get the other classes to implement that interface
interface ISolution
{
int SolveThis(int question);
}
public class SolutionClass1 : ISolution
{
...
public int SolveThis(int question)
{
return result;
}
}
ISolution solution;
int method = 3;
int result;
switch (method)
{
case 1: solution = new SolutionClass1; break;
case 2: solution = new SolutionClass2; break;
case 3: solution = new SolutionClass3; break;
case 4: solution = new SolutionClass4; break;
case 5: solution = new SolutionClass5; break;
}
result = solution.SolveThis(result);
"You get that on the big jobs."
|
|
|
|
|
hmm... this might be the solution to my question. I'll give this a shot. Thanks!
|
|
|
|
|
If the methods are different, then why not create one static class with several methods with different names or overloaded methods(assuming the signatures are different)?Do you have a particular need for naming all the methods the same in the different classes?
|
|
|
|
|
Is this a case where you can assume that every Method you will call has the same signature, and returns the same type of result ?
If that's the case, there's an interesting solution, I'll post here.
best, Bill
When I consider the brief span of my life, swallowed up in the eternity before and after, the little space which I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which knows me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then. Blaise Pascal
|
|
|
|
|
I have a user drawn form with rounded corners. I have set the .TransparencyKey of the form to the background color but when I set the SmoothingMode to .AntiAlias I get a halo effect on the corners when the form is displayed against a light background, as the background color is black. If I change the background color to SystemColors.Control I get the halo when the form is displayed against my dark desktop.
Is there a quick fix to this problem or do I have to (painfully) sample all of the colours used in the anti-alias effect and make them all transparent (if this is indeed possible) to get rid of this halo?
protected override void OnPaint(PaintEventArgs e)
{
Graphics gr = e.Graphics;
LinearGradientBrush GrBrush;
GraphicsPath gPath;
int w;
int h;
w = this.Width;
h = this.Height;
gr.SmoothingMode = SmoothingMode.HighQuality;
GrBrush = new LinearGradientBrush(new Point(0, 0), new Point(0, 75), Color.FromArgb(255, 51, 51, 51), Color.FromArgb(255, 0, 0, 0));
gPath = new GraphicsPath();
gPath.AddArc(new Rectangle(0, 0, 15, 15), 180, 90);
gPath.AddArc(new Rectangle(w-16, 0, 15, 15), 270, 90);
gPath.AddLine(new Point(w-1, 75), new Point(0, 75));
gPath.CloseAllFigures();
gr.FillPath(GrBrush, gPath);
gr.DrawPath(new Pen(GrBrush), gPath);
GrBrush = new LinearGradientBrush(new Point(0, 14), new Point(0, h-1), Color.FromArgb(255, 1, 1, 1), Color.FromArgb(255, 0, 0, 80));
gPath = new GraphicsPath();
gPath.AddArc(new Rectangle(-10, 15, 400, 50), 180, 45);
gPath.AddLine(new Point(w-1, 15), new Point(w-1, 75));
gPath.AddArc(new Rectangle(w-16, h-21, 15, 15), 0, 90);
gPath.AddArc(new Rectangle(0, h-21, 15, 15), 90, 90);
gPath.CloseAllFigures();
gr.FillPath(GrBrush, gPath);
gr.DrawPath(new Pen(GrBrush), gPath);
GrBrush = new LinearGradientBrush(new Point(5, 80), new Point(5, h-6), Color.FromArgb(255, 245, 245, 255), Color.FromArgb(255, 150, 150, 160));
gPath = new GraphicsPath();
gPath.StartFigure();
gPath.AddArc(new Rectangle(5, 80, 10, 10), 180, 90);
gPath.AddArc(new Rectangle(w-16, 80, 10, 10), 270, 90);
gPath.AddArc(new Rectangle(w-16, h-21, 10, 10), 0, 90);
gPath.AddArc(new Rectangle(5, h-21, 10, 10), 90, 90);
gPath.CloseAllFigures();
gr.FillPath(GrBrush, gPath);
gr.DrawPath(new Pen(GrBrush), gPath);
}
Any help would be appreciated. Thx.
|
|
|
|
|
Hi all!.
I would like use unmanaged code from C in C#.
I built a DLL with C code with this functions:
<pre lang="c++">
struct GetPluginData
{
int data[22];
};
DLLEXPORT extern "C" __declspec (dllexport) GetPluginData GetDataArray(int number);
In C# I've got this code:
[StructLayoutAttribute(LayoutKind.Sequential, Pack=1)]
public unsafe struct GetPluginData
{
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 22, ArraySubType = UnmanagedType.I4)]
public int[] data;
}
[DllImport("RBRPlugin.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "GetDataArray")]
[return: MarshalAs(UnmanagedType.Struct)]
public static extern GetPluginData GetDataArray(int number);
In button event or othe place code, I wrote this:
GetPluginData tes = GetDataArray(1);
And I'm getting the error: The type signature of this method is not PInvoke compatible.
I'm looking for information throught google, but no result found...
Thanks in advance!
|
|
|
|
|
There is another way you can marshal the return type from that function.
First, declare the return type from the C function to be a pointer to the GetPluginData structure instead of the structure itself.
Declare the return type as an IntPtr in C#, and then use the functions in the Marshal class to read the structure from unmanaged memory into a managed structure.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi!
Thanks for the info Richard. The solution was write for Hans Passans in StackOverflow:
[DllImport("RBRPlugin.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "GetDataArray")]
public static extern GetPluginData GetDataArray(int number);
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct GetPluginData
{
public unsafe fixed int data[22];
}
public GetPluginData temp1 = new GetPluginData();
private void button1_Click(object sender, EventArgs e)
{
GetPluginData test = GetDataArray(1);
temp1 = test;
unsafe
{
fixed (GetPluginData* p = &temp1)
{
p->data[0] = 1;
}
}
}
Like you read, the principal problem was the array in GetPluginData struct, it must be fixed.
Thaks!
|
|
|
|
|
Hi,
i am developing WCF application using MVC3.
I m using xmlserialization to serialize data.
Here is the sample code:
namespace A{
[serializable]
[DataContract(Name="User")]
[XmlAttribute("User")]
Public class User {
[DataMember(Name="ID"]
[XmlAttribute("ID"),IsRequired=false]
public void ID {get; set;}
[DataMember(Name="ID"]
[XmlAttribute("IDSpecified"),IsRequired=false]
public void IDSpecified{get; set;}
}
}
Now i am assigning values to this properties and trying to serialize xml.
User.ID=1;
User.IDSpecified=2;
It is giving error because property names are starting with same string "ID". If i change "Specified" instead of "IDSpecified" then it is serialize fine because property name is different.
So is there any rule that property name should not start wth same characters
Pls help me ASAP.
Thank you.
modified 20-Dec-11 8:49am.
|
|
|
|
|
Why cant you use
[DataMember(Name="ID"]
[XmlAttribute("ID"),IsRequired=false]
public void ID {get; set;}
[DataMember(Name="SpecifiedID"]
[XmlAttribute("SpecifiedID"),IsRequired=false]
public void SpecifiedID{get; set;}
instead of
[DataMember(Name="ID"] ***
[XmlAttribute("ID"),IsRequired=false]
public void ID {get; set;}
[DataMember(Name="ID"] ***
[XmlAttribute("IDSpecified"),IsRequired=false]
public void IDSpecified{get; set;}
Is it permitted to use same Id for two different data members ?
|
|
|
|
|