|
|
the Pronblem is i have a table of employeeinfo having attribuyes
EmpID
EmpName
EmpFatherName
GenID
now GenID is a primary key of a separate table having two attributes that is
GenID
Gender
the problem is when the form runs displaying 3 textboxes and one combobox the user must select the entry from gender and click save the values must be stored in the table of sql that is Employeeinfo i saved the first three attributes by the following code
datarow.["EmpID"] = EmpID.text;
but on GenID it gives problem bcoz i want to relate the Gender attribute to the GenID Attribute in the EmployeeInfo table and must be saved in the sql data table
sas
|
|
|
|
|
Mr.Sajid
In ur case:
I suppose ur not populating combobox with from a table; that's why u r facing the problem.
Regards
|
|
|
|
|
hi all,
I'm new user and beginner programmer . I want to ask about the way that I can shut down the pc ? I mean what is the library and function or methods that can help me to do this ?
thanks
|
|
|
|
|
|
And an even easier way (assuming your using XP, and probably Vista, but who knows) is to use:
Process.Start("shutdown", "some arguments");
And the arguments are:
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without warning
so:
Process.Start("shutdown", "-s");
Would shut down the machine.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hello everybody,
i added a column to my DataGridView with Buttons.
I created the EventHandler of CellEnter, ther'in i
like to delete this row.
The DataSource is an ArrayList of Classes which are displayed via his Members.
So if the user clicks the Delete-Button, the given record will be deleted in the database
and i refill the ArrayList with the new lines of the Database ( decreased by 1 row )
To refresh the DataGrid, i need to set the DataSource to null and re-set it to my ArrayList.
This works great in standard-functions, but not in this CellEnter-Event
I think i can't modify the DataSource of the grid because i'm into the handler of the grid.
Does anyone knows a solution?
In MFC i would make it via a PostMessage, that the code is executed after the EventHandler.
Big thanks
|
|
|
|
|
I'm trying to load an image from a file and then draw it. I found out the speed is quite unacceptable. This is the case especially when I want to render several images simultaneously using Image.FromFile() and Graphics.DrawImage() .
I wonder if there's any other way to improve the performance while rendering images?
|
|
|
|
|
That depends on how you're drawing the images, what the images are, how big they are, ... You haven't provided any useful details so it's pretty much impossible to tell you anything useful.
The quality of the answer you get is dictated by the quality of the question you ask.
|
|
|
|
|
Thank you.
What I wanna do is load all the pictures from a folder and display them all as thumbnails on a panel.
For example, I have a folder containing 50 pictures of size 3000 * 2000.
I used the Image.FromFile() to load all the pictures. And whenever a single picture was loaded, I used Graphics.DrawImage() to render it on the panel in no delay.
That's where the problem comes. The pictures came out at a incredibly low speed. Compared to Adobe Bridge, ACDSee or other softwares of that kind, I think although my algorithm may be inpropriate, there should be a better way to load and display images than using the .NET GDI+.
|
|
|
|
|
SeeBees wrote: For example, I have a folder containing 50 pictures of size 3000 * 2000.
No wonder... In order to generate the thumbnail, GDI is loads the entire file into memory then generates the thumbnail.
GDI+ is a generalized library, preferring compatibility over speed. If you want to improve performance, you'll need to find a third party graphics library that gives you the perfromance features you need. Figure out what your requirements are, then go shopping.
|
|
|
|
|
Well of course its going to be slow, you've got to load up all these images of your hard disk and put them in an image object, and the draw them all.
You could try loading up the images you need before they actually need to be drawn, that could speed things up. And im assuming (hoping) that you aren't loading up the images every time they need to be drawn.
And i think there is some function in one o' thems dll's to do a bitblit. Which may be faster. But that would require more code on your part.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Thank you. You approach is surely better.
However, I've found that using the GDI+ provided by .NET, whatever I do, even loading and displaying a single large picture is time consuming.
And I don't know the o'thems as you called it. Could you please briefly explain it to me?
|
|
|
|
|
Sadly, i don't know what the function is called, what dll it is in, or how to use it. Sorry
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Error :Object reference not set to an instance of an object.
Here is my code.
SqlConnection conn = new SqlConnection("Data Source=servername;Database=dbCustom;Integrated Security=SSPI");
SqlCommand comm = new SqlCommand("GetProjects", conn);
SqlDataAdapter adapter = new SqlDataAdapter(comm);
DataSet ds = new DataSet();
adapter.Fill(ds, "Project_ID");
ProjectidList.DataSource = ds; * it says error is on this line
ProjectidList.DataMember = ds.ToString();
|
|
|
|
|
Are there any values in the dataset. Your query might fail and in the dataset there are no tables...thus generating an error.
I will use Google before asking dumb questions
|
|
|
|
|
Im gonna guess that something went wrong when you tried to fill your dataset, or ProjectidList was not initialised properly.
Add an if statement to see if either of them are null or something.
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Two reasons:
1) Are you missing a runat="server" for ProjectidList in the ASPX page?
2) Is ds null?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Before,
adapter.Fill(ds, "Project_ID");
, open your connection ,
conn.Open();
While you forgot this the dataset is null so as it says object reference not set to an instance of an object.
Regards.
.:: Something is Wrong ::.
|
|
|
|
|
Hy!
How can i disable the print button from a PDF file using C#, if there is a way to do it? I'm using Visual-Studio 2003, .NET Framework 1.1
Thanks!
|
|
|
|
|
|
Weeeelllll.............., i need to disable that print button automatically, so i suppose i need some kind of code to do this.
Thanks anyway!
|
|
|
|
|
Well, there's no way to do that. The security dictating what the client side can and cannot do with the PDF document, including printing it, is saved in the document itself. Your ASP.NET code, which runs entirely server-side only, cannot modify the interface of the client.
|
|
|
|
|
I see......!
Thanks for being so promptly!
|
|
|
|
|
Hello all,
I have a .NET 2.0 remoting service that listens on various URIs for requests, all well and good and it works perfectly.
However I would like to add functionality that displays a custom message should somebody telnet to the listening port.
Currently if somebody does this the following is displayed:
.NET☺☻☻♥☺♥☺☺hServer encountered an internal error. To get more info turn on cust
omErrors in the server's config file.
I would like to display something like this:
My Widget Application v1.0
blah blah blah something about usage blah blah something about auditing blah blah blah
What complicates this even further is the fact that the tcp channel is registered with a compression and encryption sink. Obviously a simple command line telnet connection is not going to send any data that is either compressed or encrypted, so I need this to bypass the sinks.
So does anybody know how to do this?
-- modified at 9:13 Friday 23rd November, 2007
|
|
|
|