|
There isn't a grid in existence that will keep up with that kind of demand.
The problem isn't the grid. It's how you're using it.
The grid can only show probably 100 rows, so why are you updating grid rows that can't be shown? You don't update the data in the grid at all. You update the data source the grid is bound to.
|
|
|
|
|
Good evening, I followed the steps that you made on how t make a Remote Desktop Using C#.Net. But I can't connect to the computer that I wanted to control. Also, will I use the username and password of the current user account that is logged in to the username and password in your tutorial?
|
|
|
|
|
Don't post this here - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
And there are 13,347,998 members here, any one of which might have written the article you are talking about! Add to that the many, many thousands of article on the site, and we have no idea what article you are talking about either...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Please help me on how can I put a triangle and square shape in the center of my image. I will use plain white image so that the triangle and square shape will be visible. The first step is when I click the browse image then I will sample browse the plain white image then it will display to the picturebox1. Then there is an two button which is triange and square. If I click the triange button the plain white image will display to the picturebox2 with triangle shape in the center. Likewise when I click the square button. Please help me for my project.
this is my browse button code
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog opf = new OpenFileDialog();
opf.Filter = "Choose Image(*.jpg;*.png;*.gif)|*.jpg;*.png;*.gif";
if (opf.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(opf.FileName);
}
Bitmap bmp = new Bitmap(opf.FileName);
pictureBox1.Image = Image.FromFile(opf.FileName);
}
I have no code for triangle button and square button kindly help me on how to do it. Please
|
|
|
|
|
For starters, look at your code:
if (opf.ShowDialog() == DialogResult.OK)
{
pictureBox1.Image = Image.FromFile(opf.FileName);
}
Bitmap bmp = new Bitmap(opf.FileName);
pictureBox1.Image = Image.FromFile(opf.FileName);
Why are you doing that? Any of that, really?
If the OK button is pressed you load an image from a file. Then you load it again, and throw that away. Then you load it again and stuff it over the top of the first one you loaded.
If the Cancel button is pressed, you load the image (which will probably fail because there is no filename in the dialog) throw that away, and load it again (failing again) and muck up your picture box anyway...
Throw away the last two lines of that code. Then if and only if the user pressed OK
1) Load the image from the file
2) Copy the image into a new image and Dispose the original
3) Then set the copy as the PictureBox.Image
The reason for that is that when you create an image from a file, it locks the file until the Image is Disposed - so you need to work with a copy 99% of the time or your code fails in interesting ways later!
Then handle the PictureBox.Paint event. Inside that, you can use the supplied Graphics Context to draw over the Image using:
Graphics.DrawLine Method (Pen, Point, Point) (System.Drawing)[^] Call it three times fro your triangle.
Graphics.DrawRectangle Method (Pen, Int32, Int32, Int32, Int32) (System.Drawing)[^] Call it once to draw your rectangle.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for your reply. My point is I want to display to the picturebox2 of an square shape at the center of the plain white image when I click the button Square.
|
|
|
|
|
Then don't load the image from a file: create a new Bitmap of the right dimensions.
Then use the Graphics.FromImage method in a using block to get the context to draw on.
Use Graphics.FillRectangle to draw it as a solid white background.
Then use Graphics.DrawRectangle to draw your square.
Finally, set the Bitmap as the Image for the PictureBox.
Use a very similar process to draw your triangle with Graphics.DrawLine
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I would personally not even try to load an image. If the only reason is that you need a white background, use a panel and define the background as white. That means one less point of potential failure.
To draw on that panel you can create a "Graphics" object with the handle of that panel.
You'll need to read up on the Graphics classes, which contains many methods to draw similar like the Paint application does on your windows machine.
Hope this helps.
|
|
|
|
|
my table structures are
Customer
----------
CustomerID
FirstName
LastName
PhoneNo
Email
Order
--------
CustomerID
OrderID
OrderStatus
OrderDate
TotalPrice
OrderDetails
------------
ID
OrderID
ProductID
Qty
so now i have to show
CustomerID,FirstName,LastName,PhoneNo,Email and OrderCount
please give me a sample EF linq query
thanks
|
|
|
|
|
I'm curious, what do you think your query should look like? Have a try and come back with any problems that you encounter.
This space for rent
|
|
|
|
|
i write sql but not very good with linq to compose my below query. it will be great help if some one give me some hint
SELECT CustomerID,FirstName,LastName,PhoneNo,Email and count(*) as OrderCount
FROM Customers
INNER JOIN Orders ON Customers .CustomerID = Orders .CustomerID
GROUP BY CustomerID,FirstName,LastName,PhoneNo,Email
WHERE CustomerID=101
i compose this but take help from google search. see my sql and linq query and tell me does it give me my desired result
var data = (from c in db.customers
join o in db.orders
on c.CustomerID = o.CustomerID into subs
from sub in subs.DefaultIfEmpty()
group sub by new { c.CustomerID, c.FirstName,c.LastName,c.PhoneNo,c.Email } into gr
select new {
gr.Key.CustomerID,
gr.Key.FirstName,
gr.Key.LastName,
gr.Key.PhoneNo,
gr.Key.Email,
OrderCount = gr.Count(x => x != null)
}).ToList();
please help me if any rectification is required. thanks
|
|
|
|
|
Something like this should work:
var data = db.Customers
.Where(c => c.CustomerID == 101)
.Select(c => new
{
c.CustomerID,
c.FirstName,
c.LastName,
c.PhoneNo,
c.Email,
OrderCount = db.Orders.Count(o => o.CustomerID == c.CustomerID)
})
.ToList();
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
thank you so much sir for sharing right query with me 
|
|
|
|
|
Hi friends,
I need good graphic library for C# ,is it available like QCustomPlot
|
|
|
|
|
I've searched everywhere and found in VB, but it does not work.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim aakam031 As String = My.Computer.FileSystem.SpecialDirectories.Temp
Dim akam As String = aakam031 + "filename pashgr"
IO.File.WriteAllBytes(akam, My.Resources.file name)
Process.Start(akam)
End Sub
End Class
Anyone know how to do it in C # 
modified 17-Jan-18 20:51pm.
|
|
|
|
|
Quote: it does not work. This is not a helpful error summary, - it tells us nothing bout what the problem is. All is says is "I have a problem" - but we know that already because you are asking a question!
The other things that don't help are:
1) Showing code that you didn't try - because VB code won't compile in a C# program we have no idea what actual code you did try
2) Not explaining what the code is meant to do: I have no idea what "open a flush" is supposed to mean!
So show us the code you tried; tell us what happened that you didn't expect, or didn't happen that you did; tell us what you did to cause that to happen; explain what you expected the code to do; Tell us what you tried to find out why it did what ti did. Have you used the debugger? If not, why not? If so, what did it show?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
So this code is to run a program that i, we carry inside the project, in that resource folder.
but he is like you and I want him as C # I put it to convert more it does not work
And it's not flush, the broker showed it wrong, I meant program or file
|
|
|
|
|
|
|
And how would you do that? you can leave a sample code or sample link
|
|
|
|
|
see my sample code
public class PersonalDetail
{
public int Id { get; set; }
public string FirstName { get; set; }
public int Age { get; set; }
}
public ActionResult Index()
{
List<PersonalDetail> oPersonalDetail = new List<PersonalDetail>
{
new PersonalDetail {FirstName="Tapan",Age=11},
new PersonalDetail {FirstName="Joy",Age=21},
new PersonalDetail {FirstName="Madhu",Age=31}
};
return View();
}
when oPersonalDetail is populate then i want id should be populate automatically with 1,2,3....son on. so please guide me how could i achieve it ?
|
|
|
|
|
Assuming this is a one-time value (i.e. your data isn't persisted in a database or similar), add a class level static integer to your class, and initialize it to one:
private static int nextValue = 1; Then in your class constructor, you set the Id value to the static variable, and increment:
public PersonalDetail()
{
Id = nextValue++;
} Do note that this is not inherently thread safe, so if you need a complex program you need to look at more robust schemes - but then you are probably going to be using a database of some form to store your data instead of hardcoding it, and all databases provide mechanisms for supporting unique values for each row so that should be a concern.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You have to:
- Add a
static private member variable that holds the last assigned ID
- Provide a constructor that increments the last ID and assigns the value to
Id
- Make the incrementing and copying of the last ID member thread safe (e.g. using
Interlocked.Increment )
- Make the set method for
Id private
Possible implementations are shown in this SO thread: C# Class Auto increment ID - Stack Overflow[^]
|
|
|
|
|
If your data is going to be saved to a database, the chosen database system software can automatically assign id's / sequence numbers for you. The id is assigned when the data is added to the database.
Otherwise, any "ascending" / unique number usually will do; like a timestamp (e.g. machine + yyyymmddhh.....)
Managing "sequence numbers" yourself is usually more pain than it's worth. e.g. Running the same software on different computers usually creates "duplicates" "across" systems.
Always consider the long-term.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Until we understand your intent better, particularly why you used the reserved word 'Index ... and the unexplained method result 'ActionResult, and how 'View is a return value for the method ... well, we are not psychics.
So, clarify what you are trying to do.
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
|
|
|
|