|
You'll have to cast the return value.
public static System.UInt16 MAKEWORD(byte a, byte b)
{
return (ushort)((ushort)a | ((ushort)b << 8));
}
www.troschuetz.de
|
|
|
|
|
yes,you r right;P
thank you!
momer
|
|
|
|
|
Hi...
I have made an xml document, and uploaded it to a server...
my problem is how to uploade it again after i downloaded it..!
When i download it i do this... (not sure this is the best way to do it)
string path = @"http://www.whatever.com/web/MyFile.xml";
WebClient DLoad = new WebClient();
DLoad.DownloadFile(path, "MyFile.xml");
that works fine...!
But then when i want to uploade the file..
I have no idea how to do however i tried this...
WebClient ULoad = new WebClient();
string path = @"http://www.whatever.com/web/MyFile(1).xml";
ULoad.UploadFile(path, "MyFile.xml");
But it throws an "'System.Net.WebException' occurred in system.dll -
Additional information: The remote server returned an error: (405) Method Not Allowed."
I have no idea what to do now....
Need a way to upload the file to the server.... or to write to the xml that already is on the sever...!
Can anyone help me please...?
Thanks....!
QzRz
|
|
|
|
|
Hi All,
I have bound textboxes and other controls on a panel. If I edit the text in a textbox and move on to another control, everything works fine and I can use
HasVersion(DataRowVersion.Proposed)
to determine if there have been any changes to any control.
BUT, if I make only a single change to one text control and leave the panel afterwards by clicking into another panel on the screen, the proposed version flag is not set and I'm missing to save the change to the underlying dataset and database.
Binding:
txtCode.DataBindings.Add("Text", m_vProject, "code");
...
and after leaving the panel:
BindingManagerBase bm = BindingContext[m_vProject];
cPrjDs.tProjectRow prjRow = (cPrjDs.tProjectRow)(((DataRowView)bm.Current).Row);
if (prjRow.HasVersion(DataRowVersion.Proposed)) {
if (MessageBox.Show("save changes?", "header", ...)) {
bm.EndCurrentEdit();
To my understanding, it would be possible to catch the TextChanged event of the control and start DataRow.BeginEdit(), but this does not seem to be a practical solution for lots of controls.
Thanks for any help.
Peter
|
|
|
|
|
when i make a new windows application project and put in the main webform any control like a Button, the application throws overflow exception, but if i tried to run the application without making anychanges the application will run without exceptions, i think the problem isn't in the control because after i got the exception i removed the control from the webfrom but i still have the same error, i don't know why i got this exception while am setting the Checking Overflow/Underflow to false in the project Build properties,
anyone have suggestions ?
thanx in advance .
|
|
|
|
|
SomeOne_SurVive wrote:
when i make a new windows application project and put in the main webform
is it webform, or a windows form?
there are no facts, only interpretations
|
|
|
|
|
sorry, its a windows form , not a webform
|
|
|
|
|
Hi, just want to know what you guys do when you wish to populate DataGrid with DataSet consisting ALL customer records BUT not wanting to load ALL customers records into DataSet (or in other words, memory). For example,
DataSet dsCustomers = new DataSet();
//That's not good, you're potentially loading enough records into memory to bring down your application server.
SqlDataAdapter daCustomers = new SqlDataAdapter(
"select * from Customers", conn);
daCustomers.Fill(dsCustomers, "Customers");
dgCustomers.DataSource = dsCustomers;
dgCustomers.DataMember = "Customers";
Thanks!
Norman Fung
|
|
|
|
|
AFAIK the DataGrid has no way of dynamically loading data. There might be another grid implementation that does support...
Anyway, loading all your customers into a grid isn't a good UI practice. Its impossible to navigate that much information and make use of it. I recommend that you rethink your design to minimize the data to exactly what the user wants to see. Just a suggestion.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Yes, I can ask user to specify a WHERE clause, but solution would be nicer if I dont have to. I think you're right though - the whole point of DataSet is grab all data from SQLAdapter and work disconnected from data source - propagating changes only back to source only when you're all done in the end.
DataGrid.DataSource is anything that implements IEnumerable - Classes that implements this interface includes DataView, ArrayList, and Hashtable. IEnumerable includes one interface method:
IEnumerator GetEnumerator();
Which returns IEnumerator interface - which includes three interface methods:
1. object Current {get;}
2. bool MoveNext();
3. void Reset();
I think one can implement their own IList class, which resembles this:
class CustomerList : IList {
protected int _count=0;
protected Customer _current=null;
protected SQLConnection _con=null;
protected String _sql=null;
public CustomerList(String sql, ref SQLConnection con) {
_sql=sql;
_con=con;
}
property Object Current {
get {return _current;}
}
property int Count {
get {return _count;}
}
bool MoveNext() {
...grab directly from database everytime...
Customer cs=null;
int currentUIN=_current.getUIN() +1;
String filter=" WHERE UIN=" +currentUIN;
String sql=_sql +filter;
SqlCommand cmd= new SqlCommand(sql, _con);
_con.Open();
SqlDataReader rdr= cmd.ExecuteReader();
if(rdr.Read()) {
cs=new Customer();
cs.UIN=currentUIN;
cs.login=res.GetSqlString();
cs.email=res.GetSqlString();
... the rest of it...
_current=cs;
_con.Close();
//Get total count: "SELECT COUNT(*) FROM Customers"
... implementation ...
return true;
} else {
return false;
}
}
void Reset () {...}
}
Then, consuming it:
SQLConnection con=...;
String sql="SELECT * FROM CUSTOMERS;"
MyArrayList customerList= new MyArrayList(sql, con);
dgCustomers.DataSource = customerList;
Of course, you don't get the convenience of SQLDataAdapter.Update(), which propagate changes back in a batch --- ... is it possible to blend DataSet (100% disconnected) and CustomerList (100% connected, grab data as you go) and have the better of the two...
Norman Fung
|
|
|
|
|
I urgently need to create street-level mapping for an area in which there is no available street-level mapping from anywhere. Can somebody indicate as to how I can go about creating such a mapping (e.g. using a paper map to pass coordinates on a c# program to draw the map? can i use a database to store the points?) I am a relatively new C# programmer just starting out on GDI+.
Thanks
Chris
|
|
|
|
|
parrot123 wrote:
Can somebody indicate as to how I can go about creating such a mapping
Use a GIS system - many will have the ability to digitise data from non-digital sources (e.g. Paper maps)
parrot123 wrote:
can i use a database to store the points?
Most GIS systems will do this. Some are internal databases, others are more open.
Do you want to know more?
Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.
|
|
|
|
|
Hello,
In my void main l have Application.EnableVisualSytles
This so that l can have an application that gives the XP appearance. This works wells for all the controls apart from the toolbar icons l have. The icons do not display. If l comment out Application.EnableVisualStyles, then the toolbars display the icons ok.
This visual style used to work on my application, and all of a suddern does not work now. I was doing some changes with main, but l don't think this has anything to do with the icons not showing.
Many thanks in advance,
Steve
|
|
|
|
|
i face a problem .
the problem is summerized as following:
1- i have 600 MB of text files.
2- each text file has specific symbol to indicate a racord like *1 (means reacod number 1 and so on).
3- i want to write a boolen query like (C# and programming) the result reaturned as following : text-file + record number that contains these terms
4- i read alot about inverted file and how big is it , and how we can compress it , but i didn't reach to anything
so can any one help or give me an idea to build an index from these text and that index doesn't exceed 10% of the origianl files and suppose a method to retrieve these records ...
thanks alot
DEvX
|
|
|
|
|
Hi,
I am having an interface that i have developed in C#. i am trying to execute another exe file (already generated by a cpp program) and that exe file will take a filename as input argument and should return an array to the calling program.
Now I am having 2 problems..
1) How to execute an exe file with passing arguments to it.
2) Am i able to read the return values from the exe file.
the below ones are doubts in a cpp file (already posted in c++ forum)..but if u have any ideas... u can suggest...
3) How can i return an array of data from a cpp file as a return value from a main().
any kind of suggestions are appreciated...
thanks in advance,
Suman
|
|
|
|
|
See System.Diagnostics.Process.Start .
Instead of making a mess with data returns why don't you dump the data into a file and read back from there?
The situation you are describing seems like a mess. Make sure your final solution is somewhat robust and reliable. Maybe use P/Invoke to instead of returning the data. Or maybe rewrite in c#??
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi Alex,
thanks for ur suggestions and i did the same way as u told, like dumping the data into a file and then reading the data from it.
But i am having a problem, when the process is started using Process.Start, my calling program is not waiting for the called process to complete before it goes to next step of execution. So, i am having some inconsistent data file by tht time as the called process take some considerable time to complete.
Is there any command to make the calling program to wait untill the called process is comepleted.
thanks in advance,
Suman
|
|
|
|
|
Yes. Take a look at System.Diagnostics.Process. Method WaitForExit .
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi Alex,
yeah... i figured it out... sorry i forgot to delete my previous reply, since i figured it out after i posted the reply to you.
Anyway thanks for ur help.
Suman
|
|
|
|
|
one that will be fun to work out and get good or interesting results, or to make an existing one better, need the ideas since I can't really think of any at the moment, thanxs in advance ;P:P;P
|
|
|
|
|
Something that interfaces with a airplane simulator. The neural networks job would be to make sure the plane flies in all weather.
Something that interfaces with Counter Strike. The neural networks job would be a killing machine
Alex Korchemniy
|
|
|
|
|
something simpler since I don't have alot of time since I need to be almost finished with it in a month since I will have to do alot of work..
|
|
|
|
|
navigating a maze?
there are no facts, only interpretations
|
|
|
|
|
Given a particular string, is there a way to tell whether it contains unicode characters? I know could test every character's range, but I'm wondering if there is some API call for this. I'm looking in string, System.Text.Encoding, and Globalization, but haven't found any likely suspects yet...
Matt Gerrans
|
|
|
|
|
Strings in .NET are stored as Unicode. The encoding only matters when reading and write from and to streams (text files, network streams, etc.).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|