|
Use the System.IO.MemoryStream class. You can create an instance of this stream with a byte[] array. Pass this instance to the BinaryReader class.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Hey all! I need to learn about I/O with a pocket pc. Anyone have any good links that they could direct me to?
In either Vs 2003 or Vs 2005.
I will be one of the most sought after software developers!
www.neumont.edu
-- modified at 15:55 Tuesday 18th October, 2005
|
|
|
|
|
hi
I am creating an automated browser using axwebbrowsr control. When i make a visit to a page it shows a username password dialog box. Here, how can i fill that one.
And also i need to click a javascript menu to goto next page. Let me know is it possible. This page contains frames.
thank you.
rajesh
|
|
|
|
|
I have this set of code which is suppose to take a dataset, transfer it to a server via a web service, and then populate a databse with the information that is in the dataset however, I have an error where there appears to be no data in the dataset once it gets to the webservice, the data seems to be fine when it leaves the program, but is lost by the time it gets to the server.
userinfo is the WebService
here is the code for the program:
private void button2_Click(object sender, System.EventArgs e)<br />
{<br />
try <br />
{<br />
dg1.Tables[0].Rows[0]["COMPANYNAME"]=txtCompany.Text;<br />
dg1.Tables[0].Rows[0]["FAX"]=txtFax.Text;<br />
dg1.Tables[0].Rows[0]["PHONE"]=txtTelephone.Text;<br />
dg1.Tables[0].Rows[0]["POSTALCODE"]=txtZipcode.Text;<br />
dg1.Tables[0].Rows[0]["COUNTRY"]=txtCountry.Text;<br />
dg1.Tables[0].Rows[0]["STATEPROVINCE"]=txtState.Text;<br />
dg1.Tables[0].Rows[0]["CITY"]=txtCity.Text;<br />
dg1.Tables[0].Rows[0]["ADDRESS2"]=txtAddr2.Text;<br />
dg1.Tables[0].Rows[0]["ADDRESS1"]=txtAddr.Text;<br />
dg1.Tables[0].Rows[0]["Title"]=txtTitle.Text;<br />
dg1.Tables[0].Rows[0]["NAME"]=txtName.Text;<br />
dg1.AcceptChanges();<br />
MessageBox.Show(userinfo.SetUserInfo("uberducks2", dg1, UserID.GetValue("UID").ToString()));<br />
cmdApply.Enabled=false;<br />
}<br />
catch (Exception d)<br />
{<br />
MessageBox.Show(string.Format("Error During Runtime: {0}", d.Message));<br />
}<br />
}
This is the WebService Code:
public string SetUserInfo(string AuthID, DataSet dg1, string UserID) <br />
{<br />
if (AuthID=="*****") <br />
{<br />
try <br />
{<br />
string Name=dg1.Tables[0].Rows[0]["NAME"].ToString();<br />
string Title=dg1.Tables[0].Rows[0]["TITLE"].ToString();<br />
string Addr=dg1.Tables[0].Rows[0]["ADDRESS1"].ToString();<br />
string Addr2=dg1.Tables[0].Rows[0]["ADDRESS2"].ToString();<br />
string City=dg1.Tables[0].Rows[0]["CITY"].ToString();<br />
string State=dg1.Tables[0].Rows[0]["STATEPROVINCE"].ToString();<br />
string Country=dg1.Tables[0].Rows[0]["COUNTRY"].ToString();<br />
string Zipcode=dg1.Tables[0].Rows[0]["POSTALCODE"].ToString();<br />
string Telephone=dg1.Tables[0].Rows[0]["PHONE"].ToString();<br />
string Fax=dg1.Tables[0].Rows[0]["FAX"].ToString();<br />
Oconn.Open();<br />
string sqlcmd="UPDATE ACCOUNTUSER SET COMPANYNAME = '"+Company+"', NAME = '"+Name+"', TITLE= '"+Title+"', ADDRESS1='"+Addr+"', ADDRESS2='"+Addr2+"', CITY='"+City+"', STATEPROVINCE='"+State+"', COUNTRY='"+Country+"', POSTALCODE='"+Zipcode+"', TELEPHONE='"+Telephone+"', FAX='"+Fax+"' WHERE USERID='"+UserID+"';";<br />
SqlCommand brb=new SqlCommand(sqlcmd, Oconn);<br />
brb.ExecuteScalar();<br />
Oconn.Close();<br />
return "it seems to have worked.";<br />
} <br />
catch (Exception e) <br />
{<br />
return e.StackTrace.ToString();<br />
}<br />
}
http://digg.com
|
|
|
|
|
i want to save a file (.bmp) in a isolated storage, then delete it, how?
|
|
|
|
|
Using IsolatedStorage[^] You'll find an example of how to create a file.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone. It's me again. I am working on this project and I want to save information to this datatable, and when the user clicks submit, it should be saved into another datatable. The only problem is everything gets reset, so I was wondering if anyone knew of a way for that not to happen.
Sincerely,
The Major Rager
|
|
|
|
|
Set the data in your grid inside a !IsPostback block.
if (!IsPostback)
{
grid.DataSource = .....
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hello, thanks for replying to my question. The thing is however, that I want the user to click the submit button, and when the user does click it, the information that is in the temporary datatable should be stored into another datatable. So that !IsPostback would not work for me.
Sincerely,
The Major Rager
|
|
|
|
|
Not using IsPostback is the reason your table is being reset every time. You can copy the data in your event handler, but unless you make sure it's not reset every time using ispostback, it will be.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sori for the no-brainer commet but that's the 1st time i've seen Christian Graus post an actual code. Must be in a good mood...
But i totaly agree...by not using IsPostback, everytime you refresh the page everything resets to what you initialy set it to and thus does not display whatever changes you have made
Aim small, miss small...
|
|
|
|
|
tatchung wrote: 1st time i've seen Christian Graus post an actual code.
Really ? I post code all the time, in fact I ran up a VB project to write some code to help someone earlier today.
But yeah, I find I tell more and more people to use google. Not to be rude, but to be honest, because it's not helping them to tell them anything else. every developer needs to be able to do some research.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: every developer needs to be able to do some research.
Amen to that!
Gud luck on ur dilema ranger!
Aim small, miss small...
|
|
|
|
|
Hello, thanks for replying to my message. The !IsPostBack does not work in my case, because when the user clicks the submit button, it goes to the form load and it is a post back, so it does not get stored to the datatable.
|
|
|
|
|
I don't get it. The code to load the initial data to the form goes in the !IsPOstback block, not the code that you WANT to run on postback. That would go in an else block, surely ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
You may try to store it on a local database or a file to be not reset,or if its not so much data you may store it in the Session collection till you copy it and then delete it again.
|
|
|
|
|
I need the user from windows, so i can ot get that because when i use Environment.UserName it returns ASP.net, i do not want that, i want the user that made a logon on windows, so if exists an API from windows that returns that, or any class from asp.net, please help me.
|
|
|
|
|
Your page will be executed under the ASP.NET account, so all methods that return the current user name will return ASP.NET.
You could try to get the user who started explorer.exe (process.StartInfo.UserName)
|
|
|
|
|
Hi ALL.
In C++ the const value write in *.h file (header).
I have a lot of const values that i need to include in my code , i can open new *.cs file and write them all in it - but does C#.NET support some file like *.h (header ) file that will contain all my const values ?
Thanks for the help.
|
|
|
|
|
I think you're doing it the right way. There is no concept of a header file in C#.
Rob Philpott
|
|
|
|
|
yanshof wrote: but does C#.NET support some file like *.h (header ) file that will contain all my const values ?
No. Put them inside your class, or create a class that contains them if you like. Make them static.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm keying a table on filename, and would like to preserve capitalization for the user since spaces aren't allowed in the name (ie FileNameWithMultipleWords). I'm using a filesystemwatcher to detect when other instances of the app modify the file to update timestamp info internally. The problem is that the fsw returns an all lowercase filename (the remainder of the path is properly capitalized), and 'FileNameWithMultipleWords' doesn't match with 'filenamewithmultiplewords' when I look for the old record.
|
|
|
|
|
No, you can't force the hashtable keys to be case insensitive. You can, on the other hand, force the keys to be lower case when you create the table entry. Just call the .ToLower() method of the filename string to return the lower-case version of the string before you put it into the hashtable.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That's what I thought, I'm using the filename as a the key though, and was hoping I could preserve the capitalization for UI use without having to modify my datastructure though.
|
|
|
|
|
You can use the lowercase version of the filename as your key, but store a structure in the value portion that contains the original filename with casing.
-David
Semper Ubi Sub Ubi
|
|
|
|