|
This is Winforms. DataGridView does not have Databind method.
If I assign IList<> to DataSource, DataGridView shows data withtout Databind method.
So I think I havent missed it.
Andrus
|
|
|
|
|
I am using HttpWebRequest object for communicating with a Sun Java System Web Server. The behaviour of the Server is very random. For the same requests, sometimes I get the response and sometimes I get Internal Server Error 500.
This is a third party server which reportedly works fine with other client applications so it seems there is a problem with my code. The code is simply using HttpWebRequest and HttpWebResponse objects to massage requests and responses.
I am re-initializing the HttpWebRequest object for each new request, the reason being the fact that I cannot reassign request.ContentLength to a value once the request has begun.
Any clues?
|
|
|
|
|
You haven't supplied a lot to go on here. Without seeing the code, it's going to be difficult to diagnose what issues you are having.
|
|
|
|
|
Hi,
I am trying to connect to IPCChannel using an impersonated user and had encountered an Access Denied exception. Have anyone encountered this? Please help.
Please see some code snippets below:
Server:
BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider();
serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
System.Collections.IDictionary props = new System.Collections.Hashtable();
props["portName"] = "TestRemoteObject";
props["name"] = "TestRemoteObject";
props["authorizedGroup"] = "Everyone";
props["impersonate"] = true;
props["secure"] = true;
serverChannel = new IpcServerChannel(props, serverProvider);
ChannelServices.RegisterChannel(serverChannel, true);
RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteObject), "TestRemoteObject", WellKnownObjectMode.Singleton);
Client:
BinaryClientFormatterSinkProvider clientSink = new BinaryClientFormatterSinkProvider();
System.Collections.IDictionary clientProps = new System.Collections.Hashtable();
clientProps["secure"] = true;
clientProps["tokenImpersonationLevel"] = TokenImpersonationLevel.Delegation;
IpcClientChannel clientChannel = new IpcClientChannel(clientProps, clientSink);
ChannelServices.RegisterChannel(clientChannel, true);
// Impersonate user to use Administrator
IntPtr token;
bool result = LogonUser(
"Administrator", "MyMachine",
"MyPassword",
LogonTypes.Network,
LogonProviders.Default,
out token);
if (result)
{
WindowsIdentity identity = new WindowsIdentity(token);
using (WindowsImpersonationContext imp = identity.Impersonate())
{
try
{
RemoteObject remote = (RemoteObject)Activator.GetObject(typeof(RemoteObject), "ipc://TestRemoteObject/TestRemoteObject");
message = remote.Echo("Test");
}
catch (Exception exc)
{
message = exc.ToString();
}
imp.Undo();
}
MessageBox.Show(message);
CloseHandle(token);
}
Error Message:
System.Runtime.Remoting.RemotingException: Failed to connect to an IPC Port: Access is denied.
Server stack trace:
at System.Runtime.Remoting.Channels.Ipc.IpcPort.Connect(String portName, Boolean secure, TokenImpersonationLevel impersonationLevel, Int32 timeout)
at System.Runtime.Remoting.Channels.Ipc.ConnectionCache.GetConnection(String portName, Boolean secure, TokenImpersonationLevel level, Int32 timeout)
at System.Runtime.Remoting.Channels.Ipc.IpcClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)
If I tried to run client application using the administrator account, then connect without impersonating, it works fine. However, if I am doing impersonation it fails. Hope to get some help. Thanks in advance.
SDE
|
|
|
|
|
You are running the server and client on the same machine, right?
|
|
|
|
|
Yes.
I was wondering why it doesn't allow me to instantiate a remoting object, when I'm running on an impersonated account.
SDE
|
|
|
|
|
Hi all,
I am struggling with a problem. Please some one suggest me to get out of that. I am working with a existing website developed by some other developer long back. I that he stores the images using name genearated by Guid.NewGuid(), the name of the picture in the folder is difference with this name in database.
Now I have to develop a service to delete the images older than 15 days. My problem is i am retrieving the filename from database, but that file name is not equal to the file name in folder.
I dnt knw why he used Guid.NewGuid(), can any one please tell me what is the use and advantage of Guid.NewGuid() , also how to solve my issue.
Thanks in advance
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: Guid.NewGuid(),
It generates a unique GUID.
Exelioindia wrote: Now I have to develop a service to delete the images older than 15 days. My problem is i am retrieving the filename from database, but that file name is not equal to the file name in folder.
Then you can check the file's creation date and if it is more than 15 days, delete it.
|
|
|
|
|
Yor are correct, but along with that i am checking for some other conditions also in database
Thanks for you reply
Know is Drop, Unknown is Ocean
|
|
|
|
|
Exelioindia wrote: I dnt knw why he used Guid.NewGuid(), can any one please tell me what is the use and advantage of Guid.NewGuid()
This is a common design to get round name collision issues. Basically, you can have two files called Document1.doc from different users - you can only store one of these in a directory, so you need to generate a unique name and associate this with the document. In other words, you rename the file from Document1.doc to your guid named file and you have a mapping in the database that shows the original filename and the new filename.
|
|
|
|
|
hi to all,
i published a website using solutionexplorer in asp.net 2.0 and usually i get the published folder containing the files but today i m unable to get the folder with files after publishing it is giving publish succeeded but there are no files in it how to resolve this problem i m using vss version 6.0 and all folders are checkedin
sai krishna
|
|
|
|
|
First of all it is not a C# question. You must post questions in the appropriate forums.
Solution: When you click on publish it must have asked you for the path. Try changing the path. And then copy the path and see that do the files exist after publishing.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Well, I didn't know where should I ask my question, so I ask it here!
I'm willing to know what exactly happened (for OS and whom it may concern!) when a running application calls a function or a sub or a method?
And is there any way to get the name of that function or sub or method?
Thanks.
|
|
|
|
|
pm526467 wrote: I'm willing to know what exactly happened (for OS and whom it may concern!) when a running application calls a function or a sub or a method?
Usually the function's (or sub's or method's) code is executed.
pm526467 wrote: And is there any way to get the name of that function or sub or method?
Of course.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[Image resize DLL]
|
|
|
|
|
Oh! Thank you very much dear CPallini! That was really helpfull!
Would you mind telling me HOW can I get those name (in C# of course)?
|
|
|
|
|
hi there... I have one problem, and I cannot solve, so any help will be appreciated. I have a datagridview control on a windows form. I am using the form for retrieving data from a local database, and then cleaning up the selected data. So I want to add a checkbox column, when the user will check the checkbox, that would mean that the row is selected, and he can delete just the checked rows. How I can do that, any help? Thx
|
|
|
|
|
Add a checkbox column to your grid. When user clicks on delete button or whatever for deletion, just filter the rows which have the checkbox checked and delete them.
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
|
the thing is that I am creating a datagridviewcheckboxcolumn control on runtime...I want to know how to create an event for the control, cause I cannot get properties window for the control, because I am creating the control on runtime. I want to add a CheckedChanged event. How I can do that? Thx in advance
|
|
|
|
|
haven't you looked at step-3 of the link which i have given you.
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
that is for web app, I am making a win app and I am creating the control on runtime, that's why I do not know how to reach the events of the control. How I can reach the events for a control what is created on runtime? Thx
|
|
|
|
|
This is going to be dumb, but I can't figure it out for the life of me. I am using placeholders in a global resource file, I have found that the string is too long so I want to put in a line break dynamically, now since this is multi lingual the break may need to be in different places depending on the language. When I enter " " as one of the placeholders it encodes the text which makes the HTML not render no matter what I do. I have tried to decode it, but that didn't work. My string looks like this Results for room {0}.{1}All shown rooms are suitable for {2} adults and {3} children Here is my code (the br may not show up)
divResultsHeader.InnerText = string.Format(Translate("resultsHeader"),
RoomNum.ToString(),
"<br />",
infoObject.ReservationRoomInfoList[RoomNum-1].NumberAdults.ToString(),
infoObject.ReservationRoomInfoList[RoomNum-1].NumberChildren.ToString());
|
|
|
|
|
Use the InnerHtml property instead of InnerText .
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
That didn't work, it's still encoded the br tag.
|
|
|
|
|
Then you did something wrong. What does the code look like?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|