|
sir,i haven't understand what u told
|
|
|
|
|
Well that is a really bad design. Each click of the button should create another SET of 30 records in the sames table. you should then edit the values in the Set of record.
Do NOT create a new table per click.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How can we help you if we don't know what you have tried, and what your goal is ?
Why are you building a new DataTable on each button-click.
Show your code.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
How add and delete multiple DLL references from C# project programmatically. I have seen http://www.codeproject.com/Articles/11658/Programmatically-add-references-to-Visual-Studio-N but when I run this project, am seeing that the DLL is not getting added to the active project. My requirements are slightly different.
- I need to be able to add the csproj or sln file path in text box and add it to the list that needs DLL reference to be added
- Need be able to select and add the DLL (or DLLs) to the projects selected in previous step.
- Lastly am doing all this in VS 2015 and not older version.
Can anyone please help me on how I can proceed next?
Thanks
AU
modified 5-Aug-16 7:21am.
|
|
|
|
|
I see that the article author is not active on CP anymore. You can try and understand what the article does, how it does and extend it as per your needs.
It is unlikely that someone here would do this for you.
"You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this goddamn clusterfuck.", BruceN[ ^]
|
|
|
|
|
Are you saying that when you download the source from that article, and compile it, it does not work ?
If so, what doesn't work ? Is there an error ? What is the error ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
Yes, I downloaded that and when I try to add the reference it errors out. I verified by debugging through the code while adding the reference. Wanted to check if there is any new API or method to get this done, the source code downloaded is very old one.
THanks
AU
|
|
|
|
|
Hello
How can I take a picture with a webcam in C #
Thank you
|
|
|
|
|
Well, you could always use EmguCV to accomplish this. It has a decent sample of working with the web camera here[^].
This space for rent
|
|
|
|
|
The AForge project is also useful (a NuGet package is available). The VideoCaptureDevice has a NewFrame event, and there you should clone the current picture from the EventArgs by new Bitmap(eventArgs.Frame) (the original bitmap given in the eventargs may be overwritten later).
|
|
|
|
|
Hello
How can I burn a CD with C#
Thank you
modified 4-Aug-16 15:06pm.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So please try to explain what you have tried, where you are stuck, and what help you need.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Did you even try Googling before posting? This was one of the first results I encountered:
/ravi
|
|
|
|
|
Hi,
I'd like to know if it's possible to get a collection of something with LINQ with the 'where' clause equal to a function that has a ref parameter.
var objCol = from id in ids
where id.GetValue(2, ref strValue) == "6"
select id;
The result should be based on the ref value.
Thanks
|
|
|
|
|
It certainly is possible. Here's a little sample for you to try:
public class LinqTester
{
public void Test()
{
LinqCollection collection = new LinqCollection(
List<LinqItem> values = collection.Where(x =>
{
string value = string.Empty;
x.GetValue(6, ref value);
return value == "6";
}).ToList();
}
}
public class LinqCollection : List<LinqItem>
{
public LinqCollection()
{
for (int i = 0; i < 10; i++)
{
this.Add(new LinqItem { Id = i });
}
}
}
public class LinqItem
{
public int Id { get; set; }
public void GetValue(int item, ref string value)
{
value = Id.ToString();
}
}
This space for rent
|
|
|
|
|
Well, you can, as Pete showed you. But it's not really a good idea, and probably won't work as you want it to.
It would be better to change the method so that it doesn't use a ref or out parameter. If you can't change it, then write a wrapper method.
You can either return a specific type to encapsulate the two returned values, or use a Tuple[^]. In C#7, there will even be built-in language support for tuples[^], which will make this much easier.
static class YourExtensions
{
public static Tuple<string, string> GetValue(this YourType id, int theParameter)
{
string strValue = null;
string result = id.GetValue(theParameter, ref strValue);
return Tuple.Create(result, strValue);
}
}
...
var objCol = from id in ids
let value = id.GetValue(2)
where value.Item1 == "6"
select new { id, strValue = value.Item2 };
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am using System.IO.Compression to create zip file of PDF or CSV files. I used CompressionLevel.Optimal to maximize the compression ratio. However, the percent of compression is 10-12%.
Was wondering if there is another efficient way to do it?
Framework: 4.5
|
|
|
|
|
Generally speaking, PDF files are already compressed, and don't compress much further - 4% is about what I expect. CSV files on the other hand are text and I'd expect them to reduce by 75% or more unless they are extremely small (when the overhead on ZIP files starts to outweigh the compression).
So I'd start by using a commercial package such as WinZIP to compress your files for testing and compare those results with the ratios you are getting with your app. Getting the same kind of compression for two file formats that are so different internally is suspicious to my mind.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
OriginalGriff wrote: a commercial package such as WinZIP
Is there anything that WinZip can do that 7-Zip[^] can't?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sit on my computer?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Using 7zip is going to require a C# wrapper, like SevenZipSharp: [^].
However, since .NET now provides GZip, I use that, and it's quite powerful.
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
If you're using it from code, yes.
But OG's suggestion was to use WinZip to manually compress the files, to see how much compression could reasonably be expected. I was just pointing out that you don't need to pay for a tool to do that.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I am using the following code line to input a .obj file with an associated .mtl file and several associated .jpg files pointed to by the .mtl file:
aerobaticsSceneControl.Scene - SerializationEngine.Instance.LoadScene(modelFile);
where model file the pointer to the .obj file.
I have on .obj file that loads correctly. However in another file I have downloaded I get the following exception message at the line above:
An unhandled exception of type System.ArgumentNullException; occurred in mscorlib.dll
Additional Information Value can not be null
I get the following debug messages which as someone new to this type of programming doesn't make any sense:
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\Aerobatics Scene.vshost.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x17dc has exited with code 0 (0x0).
The thread 0x5678 has exited with code 0 (0x0).
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\Aerobatics Scene.exe'. Symbols loaded.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.SceneGraph.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.WinForms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'D:\Aerobatics Project\Mitch's Stuff\July 13\Aerobatics Project\Aerobatics Scene\bin\Debug\SharpGL.Serialization.dll'. Symbols loaded.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Composition\v4.0_4.0.0.0__b77a5c561934e089\System.ComponentModel.Composition.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'Aerobatics Scene.vshost.exe' (CLR v4.0.30319: Aerobatics Scene.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Exception thrown: 'System.ArgumentNullException' in mscorlib.dll
The program '[22836] Aerobatics Scene.vshost.exe' has exited with code -1 (0xffffffff).
I've used 3-D Builder to make sure that all the .jpg files properly link to the pointers in the .mtl file and that all seems Ok.
I'd appreciate any suggestions on where to go from here. Model loads properly when I remove the pointer to the .mtl file from the .obj file so at least I know the .obj file is not a fault.
Thanks for any help,
Andy Cruce
|
|
|
|
|
You need to go back to the point in your code where the error occurred to try and establish which variable does not contain the correct value. Use a breakpoint and your debugger to stop the program just before that point and step through to see what is happening.
|
|
|
|
|
Andy, when you post a question like this, it's helpful to provide a little bit more information. For instance, you're leaving us to guess where SerializationEngine comes from, so while I assume you're talking about SharpGL I can't be certain this is the case. As a hint, when you're running the application inside Visual Studio, you can get the stack trace where the exception occurs. When you get the exception dialog, choose to copy the details of the exception as this lists the full stack and gives you more of an idea where the problem is. Also, if the code you're running against is SharpGL, you can download and build it yourself and step into the code while you're debugging.
This space for rent
|
|
|
|