|
Thx
Hi,
AW
|
|
|
|
|
I have a data grid I have extended.
in the paint event a need to draw a red line through each row that contains a void. how would i from
DataGrid.BindingContext loop through each one. one by one
nicl
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Does anyone have a link ro what not to override this method
I need to customize the row header icon and draw a line through the row if the void property is true
and ideas?
nbick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I use OnPaint in DataGrid to autosize one of their columns. It works unexpectedly good ... with some exceptions (not Exceptions). In some cases it gives neverending loops. Now I'm working on it.
Hi,
AW
|
|
|
|
|
it would be much easier to override SetValueAtRow and caluclate the column width there inside the column class
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Dear to all programmers,
I do have a problem here... regarding about Network Management Tools.
I do have question whether C# can be use to create an application that will manage the Network Side (as a tools). Is it possible??
And also i want to know whether i can using Java Language to create the NMT.
Any recommend using what software to develop in the most quick time around a month?
Thanks
|
|
|
|
|
hi,
how can i make a combobox un-editable?
that means the text value can only selected inside collection items. user can enter other value in the combobox at runtime.
how can i do that? i can't see any property related to this!
thanks,
jim
|
|
|
|
|
DropDownStyle = DropDownList
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I just wasted a massive amount of time debugging my application and it's all because of a directory path error
I currently save an XML data file "movies.xml" in the root path of my project's .exe file. The problem is that after I use an OpenFileDialog to select some data to add to the XML file, and then save it, the file's saved in the directory that was selected, rather than the root path I need.
How can I point a StreamWriter, for example, to the absolute path of my executable dynamically?
I'd imagine it's something in the System.Reflection namespace, but I can't find it and don't know where to start looking.
Also, is there a way to prevent the directory selection of an OpenFileDialog from overwriting the current "working" path?
|
|
|
|
|
Application.StartupPath ?
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
|
Hi All,
I dunno if I'm being blind or a bit stupid, but this problem is bugging me now
Im trying to connect to a share on a server on a different domain, I know that if the user logged
on and running program has credentials for this share then it works easily simply using Directory and File from System.IO,
However I cant give the users access to the server itself so I need the program to control its own access by specifying the un/pw/domain name at time of connection , I thought this owuld be easy considering that the Framework is by definition geared towards internetworking , but I guess I may be wrong !
I can make the connection Ok if I call the 'net use' command from a diagnostics process, but I dont like this, because of timing and the potential security risk, IE if the program crashes then the user will have access to the particular network share through my computer.
THe other way I know of, is to wrap the functions of MPR.DLL and simply use WNET to make and destroy my connections ... this works fine but doesn't seem like the best solution ...
Anybody have any ideas or indeed the correct way of doing this ?
Thanks very much.
|
|
|
|
|
|
Hi, I tried to use SQLDMO to get a list of available sqlserver's name in .Net with C#. Here is my code:
SQLDMO.ApplicationClass oSQLServerDMOApp = new SQLDMO.ApplicationClass();<br />
SQLDMO.NameList oNameList;<br />
oNameList=oSQLServerDMOApp.ListAvailableSQLServers();
However, it always failed at the last code of "ListAvailableSQLServers".
Can anyone please tell me why? (I have been worked on this for weeks) Thank you very much.
|
|
|
|
|
I need to position a form in certain place. Supposed I have a form named "form1", I did this:
form1.StartPosition = FormStartPosition.Manual;
form1.Location = new Point( 100, 100 );
But it doesn't work. The form1 just keep staying at (0, 0). Can anyone tell me why?
Thanks in advance!
|
|
|
|
|
sorry, There's a bug in my program. Now is ok. Thanks for reading.
|
|
|
|
|
How to bind a ComboBox to an valuable? Such as, I want to bind the ComboBox.SelectedItem and another valuable(string s) together. How can I do that?
Thanks!
|
|
|
|
|
I'm not sure I fully understand your problem. Btw look at MSDN
library: (ex: ComboBox.DataSource).
Using DataSource property to associate a collection to your ComboBox, you have both a "DisplayMember" property, and a "ValueMember" property. I think this will solve your problem.
Gilles
|
|
|
|
|
Sorry, I didn't make myself very clear. Thank you for answering and I got confused about this for a long time.
But now my problem is: I want to connect a valuable and a combobox together. when the valuable changes, the selection of combobox changes too. on the other hand, when the selection of combobox change, this valuable will change too.
But I don't know how to do that in C#. Do you have any ideas about this one?
Thanks in advance.
|
|
|
|
|
a value or a variable
ComboBox1 has its own items including ID which dictates COmboBox2
Table1
CustomerName
CustomerID
Table2
StoreName
StoreID
CustomerID
As you can see the relationship is a customer has 0 or many stores and a store must have 1 customer
ComboBox1.DataSource = Table["CUstomer"].DefaultView;
ComboBox1.DisplayMember = "Name";
ComboBox1.ValueMember = "ID";
ComboBox2.DataSource = Table["Stores"].DefaultView;
ComboBox2.DisplayMember = "Name";
ComboBox2.ValueMember = ComboBox1.SelectedValue;
try that out, when you change combo1 the combo2 is updated based on the relationshipID.
to make them change each other makes no sense really, its a circular relationship which would require for you to hand pick the relationships in which
you would sink the SelectedIndex_Changed event and make your changes there.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I wrote the code using DataBindings like that:
checkBox1.DataBindings.Add("Checked", MyClass, "bValue" );
"checkBox1.Checked" and MyClass.bValue were supposed to be changed whenever the other one was changed.
But, when I changed the value of check1.Checked, like this:
checkBox1.Checked = false;
MyClass.Value was not changed.
Can anyone tell me why?
Thanks in advance!
|
|
|
|
|
what does more code look like?
I mean does your class have get and set accessors. dont use public fields because you need to validate the data. what if a null comes from a database or somewhere. your code will break.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I am trying to automate login to a site for a subsequent file upload. Even though I set the Content-Length header I keep getting the 411 (length required) response error.
I begin with an initial unauthorized request to a form-authenticated page.
I extract the session cookie from the response header and attach it to the next request I send by POST method, along with the required authentication info. The program halts as soon as I try to access the next response, referring to the abovementioned error code.
Please tell me what I'm missing...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
using System;
using System.Net;
using System.Web;
using System.Text;
using System.IO;
public class Loader {
private HttpWebRequest request;
private HttpWebResponse response;
private CookieCollection cookies;
private string url = "http://www.somedomain.com/member/home.jsp";
private string logPath = @"c:\\loader\response.log";
/*-------------------------------------------------------------------------*/
public static void Main() {
Loader loader = new Loader();
loader.MakeInitRequest();
loader.SendAuthInfo();
} // end Main
/*-------------------------------------------------------------------------*/
public void MakeInitRequest() {
request = (HttpWebRequest) WebRequest.Create(url);
// Set the request's CookieContainer
request.CookieContainer = new CookieContainer();
response = (HttpWebResponse) request.GetResponse();
// Capture cookies from the initial response
cookies = response.Cookies;
// Log the response
this.LogResponse("\n\n************INITIAL RESPONSE:************\n\n");
response.Close();
} // end MakeInitRequest
/*-------------------------------------------------------------------------*/
public void SendAuthInfo() {
string username = "my_username";
string password = "my_password";
string postData = "j_username=" + HttpUtility.UrlEncode(username) +
"&j_password=" + HttpUtility.UrlEncode(password);
byte[] postDataBytes = Encoding.ASCII.GetBytes(postData);
request = (HttpWebRequest) WebRequest.Create(url);
// Set the cookies from the initial response to this request
if (cookies != null) {
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(cookies);
}
// Set the request headers
request.Method = "POST";
request.ContentType = "application-www-form-urlencoded";
request.ContentLength = postDataBytes.Length;
// Post authentication info
StreamWriter writer = new StreamWriter( request.GetRequestStream() );
writer.Write(postDataBytes);
// Log the response
response = (HttpWebResponse) request.GetResponse();
this.LogResponse("\n\n************NEXT RESPONSE************\n\n");
response.Close();
writer.Close();
} // end SendAuthInfo
/*-------------------------------------------------------------------------*/
private string DisplayResponseHeaders(WebHeaderCollection headers) {
StringBuilder buffer = new StringBuilder();
// Capture each header:value pair
foreach(string header in headers) {
buffer.Append(header + ": " + headers[header] + "\n");
}
return buffer.ToString();
} // end DisplayResponseHeaders
/*-------------------------------------------------------------------------*/
private void LogResponse(string title) {
FileStream fStream =
new FileStream(logPath, FileMode.Append, FileAccess.Write);
StreamWriter logWriter = new StreamWriter(fStream);
StreamReader reader = new StreamReader(response.GetResponseStream());
string responseString;
// Log the response
responseString =
this.DisplayResponseHeaders(response.Headers) +
reader.ReadToEnd();
logWriter.Write(title + responseString);
reader.Close();
logWriter.Close();
fStream.Close();
} // end LogResponse
/*-------------------------------------------------------------------------*/
} // end class Loader
|
|
|
|
|
|
I have created a Database Object on a Remoting Server that is not disposing when the function call is returned? Why would this be happening?
|
|
|
|