|
You know in your heart of hearts that for me, this is not harsh at all.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
|
I wanted to create a program for controlling stepper motors using c # using serial port how to
|
|
|
|
|
|
|
I need to create a new data table that contain 30 values on every click of a button.the table should contain 30 default values and that values should be editable.on editing it will have the newly edited value instead of default value.
for example:
on first click of button I created a table_01.
It will have 30 default values has zeros
1 0000
2 0000...etc upto 30
on second click of button it should create as table_02
It will have 30 default has zeros
1 0000
...
29 0000
30 0000
if I double click on 29 th value and replace 0000 by 1111 means it should hold 1111 as its value by replacing 0000.
how to achieve it,please help me
|
|
|
|
|
You have left out plenty of information that can help you get an answer. Having said that, try this:
- Create a UI that will allow you to display and edit the table data. You can choose an appropriate control based on technology you are using.
- Handle the click event of the button and create a table object in it. Also, add 30 rows to it.
- In case you want to retain all the tables, make sure they are stored in some class level list (for desktop applications) or in session or any other appropriate object/file (for web application).
In case you still have problems in achieving, please provide the code as well that you had tried. Make sure to post only the relevant code and also format it using code link on top of editor.
"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[ ^]
|
|
|
|
|
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
|
|
|
|