|
I see your confusion. The read process goes like this:
1. Call BeginRead()
2. The code enters your read callback when data is ready
3. You see how many bytes you have now in bytesRead
4. Take the bytes you want out of the read buffer.
5. Use these bytes before calling BeginRead() with the same buffer.
6. Look back to step 1 until you're done.
John
"You said a whole sentence with no words in it, and I understood you!" -- my wife as she cries about slowly becoming a geek.
|
|
|
|
|
When i load dialog box on top of my activex control twice,my web page getting stuck.
how can i solve this problem.
thanks
|
|
|
|
|
Hello Everyone!
Well, as the header states, I don't get the Parse Event raised/fired.
This is my situation:
I have a DateTimePicker and a checkbox infront of it.
Parse Event:
If the checkbox is unchecked, the DataBinding is supposed to write null into the database (this means that the structural design wo which this date belongs hasn't been released).
Is the checkbox checked, the Value of the DateTimePicker is supposed to be written in the database.
FormatEvent:
If the field in the database contains a null value, the checkbox gets disabled (and so through another event the DateTimePicker).
Is there a date in the database, the checkbox gets enabled and marks the structural design as "released".
Well, the Format Event works fine, the Parse does nothing.
From the MSDN I understand that it gets raised under three conditions:
* after the Validated event of the Control object occurs.
* when the EndCurrentEdit method of the BindingManagerBase is called.
* when the Current object of the BindingManagerBase changes (in other words, when the Position changes).
I tried to force all of them, nothing happens.
Well here is my Code:
The Binding:
Binding bind = new Binding("Text", Ergo.MainApp._DesignDB._SelDesignDV, "Freigabe_Datum");<br />
bind.Parse += new ConvertEventHandler(bind_Parse);<br />
bind.Format += new ConvertEventHandler(bind_Format);<br />
this.dTP_Freigabe.DataBindings.Add(bind);
The Events:
private void bind_Format(object sender, ConvertEventArgs e)<br />
{<br />
if (e.Value == System.DBNull.Value)<br />
this.chBx_Freigabe.Checked = false;<br />
else<br />
this.chBx_Freigabe.Checked = true;<br />
}<br />
<br />
private void bind_Parse(object sender, ConvertEventArgs e)<br />
{ <br />
<br />
MessageBox.Show("Holla");<br />
if (!this.chBx_Freigabe.Checked )<br />
e.Value = System.DBNull.Value;<br />
}
Here I get the Currency Manager:
myCM = (CurrencyManager)BindingContext[Ergo.MainApp._DesignDB._SelDesignDV];
Here I tried to call EndCurrendEdit():
BindingContext bc = this.BindingContext; <br />
bc[Ergo.MainApp._DesignDB._SelDesignDV].EndCurrentEdit();<br />
myCM.EndCurrentEdit();
and here is the DataBase Update:
public void UploadDataView(BindingContext bc)
{ <br />
bc[selDesignDV].EndCurrentEdit(); <br />
OleDbCommandBuilder cb = new OleDbCommandBuilder(designDA); <br />
try <br />
{ <br />
designDA.Update(designDS, "Zeichnungen"); <br />
} <br />
catch(Exception ex) <br />
{ <br />
MessageBox.Show(ex.Message, "Fehler beim Upload der Daten - UploadDataView"); <br />
} <br />
}
The DateTimePicker is bound to a DataView.
All other bindings in my form (without events) are working fine, so I guess the problem is just the raising of the Parse Event.
I even included a Validated Event, but that didn't do it either...
Every help is GREATLY appreciated, since this is the only thing that stops the first part of my program from beeing finished...
And did I mention that I have absolutly the opposite of much time?
|
|
|
|
|
I would like to register a set of hotkeys for my TextBox
For example, when I press Ctrl+0 or Ctrl+N, the Text property of TextBox will be set to "<null>" string.
Any suggestion?
|
|
|
|
|
|
I have a tiff file that I need to dispay on a form. The picture box class apparently does not support tiff. I can convert the file to Bitonal but the image loses a lot.
Being fairly new to C# can someone recommend a way to accomplish my task of opening a tiff file into a windows form? (picturebox or whatever?)
thanks.
Bob
|
|
|
|
|
You are right. I was surprised the designer doesnt support it. Try it this way:
pictureBox1.Image = new Bitmap("C:\\test.tif");
|
|
|
|
|
Is there any other way to calculate network utilzation except using PerformanceCounter ??
|
|
|
|
|
I am wondering if there is way to keep the nice method descriptions, available at programming time, if you compile the class to .dll. Will be nice for fellow programmers when using my classes.
|
|
|
|
|
Yes. Use XML documentation (3 forward slashes), and go into your project properties and enable XML documentation file. Name the xml documentation file <yourdllname>.xml
When other developers go to use your dll, IDEs such as Visual Studio will realize there is a documentation file available, and will use that to populate intellisense.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: The Secular Left, the Religious Right, and Prejudice
Judah Himango
|
|
|
|
|
Thanks - This helps me alot
|
|
|
|
|
Go take a look at NDOC.
http://ndoc.sourceforge.net
it is free and allows you to document your classes from inside your code and build a MSDN type class reference file that can be used within or outside of your assembly.
Bob Robey
|
|
|
|
|
After you have enabled the xml docs ,then :
In commenting claases and methods just use before them
///<summary>
///Summary description for Your class or Method.
///</summary>
If you want to comment a parameter then use:
/// <summary>
///
/// </summary>
/// <param name="Your Second parameter name"></param>
/// <param name="Your First parameter name"></param>
as < summary >s stands to the method description and param to the parameters ,and you can use any number of parameters.
|
|
|
|
|
I did drop only two TextBox-es one for username next for password.
But how can i write code to checked in SQLServer username and password then to back me response???
|
|
|
|
|
1 :When you reply just click on the message and then there is a link called reply just click on it ,instead of launching a new thread.
2 : Create a database and then any table in it called USERS for example ,and add fields called username and password ,etc... .
And then try to ckek it by using a datareader to check if it's in the database or otherwise.
|
|
|
|
|
In one my appliation whicha i create by C# i need in page_Load to show me a new form in wich I must give username and password. So can somebody help me how to coding for username and password which's must analysed in SQLServer then to get back me a response.
If username and password is incorrect get error.
If username and password is correct get show next page.
HELP
|
|
|
|
|
Try to make another form in your project that contains only 2 textboxs ,and then try to code this ,and if any problem presents we will help you so much more.
|
|
|
|
|
I am trying to create a main table from a dataset that may have mutiple tables all with the same structure any clues. I need to end up with one table at the end where am i going wrong as i get the error table1 already belongs.
here is my code
//get all table into one ready to show and print
DataTable tblNew;
tblNew = dst.Tables[0].Copy(); //get the sructure and data
for(int i = 1;i
|
|
|
|
|
Do you mean you want to add all the tables in this dataset to that table ?after each other ?
|
|
|
|
|
the user suplies me with say 5 tables all schemas are identical, I want to take all the rows from the 5 tables and crew a new single table containg all the rows from the 5 tables so as i end up with one single table(then not interested in what happens to the original 5 tables) As I need to end up with dst.writexml with only one table being printed and not 5 as i can use that in my crystal report.
|
|
|
|
|
lets say that they are in an array :
DataTable[] tbls = new DataTable[5];
DataTable final = new DataTable("All");
for(int i=0;i<5;i++)
{
foreach(DataRow r in tbls[i].Rows)
{
this.final.Rows.Add(r);
}
}
Hope that helps.
|
|
|
|
|
I want to create an Access database on my PocketPC (WinCE4.2, PocketPC 2003 OS). Then using C# to populate tables, query tables, ...
From a simple search on Google.com I find that I must use ADOCE.NET but I didn't succeed to download it and also didn't see any control that I can use from Visual Studio 2003 (I created a project for Smart Mobile Device).
Is there any one has experiences doing such kind of work?
Best regards,
A. Riazi
|
|
|
|
|
Hi,
In a interface i am using private access specifier , will compling will it give error or not, if it give error then what is that error.
thanks
|
|
|
|
|
NO! its not allowed to put any access modifier behind function defination in interface, be it private, public, protected or internal.
Ali
|
|
|
|
|
Using a private in an interface is illogical.
The private specifier is telling the compliler that the method/property/field is accessible to ONLY other members of this specific class. As interfaces have no implementation nothing could ever use something declared as private within an interface.
As a general note: Interfaces are definitions for part of an exposed parts of a class so that other code can see that a class implements an interface and therefore know that it can call certain methods or properties even if it knows nothing else about the class.
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|