|
It's considered rude.
If you want to find out how post back in ASP.NET works try reading the freaking documentation!
Sorry for the outburst everyone but it's like the 15th time today I have seen this type of lazy garbage and on top of it this jerk reposts his question.
|
|
|
|
|
The best way to avoid postbacks is to not develop Web applications.
|
|
|
|
|
Well, it is guaranteed to work
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
very funny well i did post the coding i just not want to execute the code on every post back
any help will be highly appreciated
|
|
|
|
|
Hello I have coding experience in C++ in Visual Studio but not in C# besides basic hello world and I want to create something like this
http://img521.imageshack.us/my.php?image=gogulexl4.jpg
basically it is a embeded browser window inside another window the main window I should be able to use goole normally or any other site and automatically extract some search queries when I click on a button or something(to be thought of later on).
Thank you in advance
hello
|
|
|
|
|
If I understand what you are looking for, you should be able to create a basic windows form application and then use the web browser control to embed Internet Explorer into the application.
|
|
|
|
|
WebBrowser Control[^] is what you want.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
How do you go about documenting the implementation of an interface? Do you just copy the interface comment to your implementation? Skip documenting the implementation? Create a new unique comment for the implementation?
public interface IMyInterface
{
int GetSomething (int param1);
}
public class MyClass : IMyInterface
{
public int GetSomething (int param1);
{
}
}
I'm currently leaning towards reusing the interface comment and figured out how to have it auto-magically included in the implementation with the following code. NOTE: you'll need to make a post-build copy of your XML files and reference those otherwise you'll get a file in use error.
public class MyClass : IMyInterface
{
int GetSomething (int param1);
{
}
}
p.s. is there an easy way to paste code with special characters (< > &) so it automatically converts them to their encoded form?
-- modified at 16:36 Thursday 29th November, 2007
Todd Smith
|
|
|
|
|
That may depend on what the thing does, but probably start by copying the comment and maybe add detail.
public interface IDataSource
{
int GetSomething (int param1);
}
class DataBase : IDataSource
{
int GetSomething (int param1) ...
}
class WebService : IDataSource
{
int GetSomething (int param1) ...
}
|
|
|
|
|
Ok this should be simple.
I made a form, added a combobox (for selecting items to edit, not for updating fields), several textboxes, a few checkboxes etc. On formshow it connects to my database, draws down the existing data, no problem. All the records in the datatable that were the result of a query, I could select from, and the other databound components would display the records contents, no problem..... however.... when i add a new row, the combobox updates, but if i select the NEW item in it, all the databound objects are still pointing to the record to which I had selected prior, and if i make changes to their contents, it updates the fields associated with the priorily selected record, I can still select the original records and edit their contents just fine... but the NEW record's contents never display, and the record to which the databound objects are pointing, never change either... can someone please help before all my hair turns white ? LOL
the setup code that establishes databindings and populates the data table is as follows.
mySqlDataAdapter1.SelectCommand =
new MySql.Data.MySqlClient.MySqlCommand(
"SELECT *,CONCAT(ENTRY_NO,\":\", TYPENAME) AS DISPLAYVAL FROM FILEINFO.FILETYPE ORDER BY TYPENAME",
mySqlConnection1);
mySqlDataAdapter1.Fill(dataSet1);
ComboList = new DataTable();
ComboList = dataSet1.Tables[0];
comboBox1.DataSource = ComboList;
comboBox1.DisplayMember = "DISPLAYVAL";
comboBox1.ValueMember = "ENTRY_NO";
FILENAME.DataBindings.Clear();
FILENAME.DataBindings.Add("TEXT", ComboList, "TYPENAME");
DESCRIPTION.DataBindings.Clear();
DESCRIPTION.DataBindings.Add("TEXT", ComboList, "DESCRIPTION");
FILEEXT.DataBindings.Clear();
FILEEXT.DataBindings.Add("TEXT", ComboList, "EXTENSION");
RECLENGTH.DataBindings.Clear();
RECLENGTH.DataBindings.Add("TEXT", ComboList, "RECORDLENGTH");
RECLENGTH.CausesValidation = true;
ISRECDELIM.DataBindings.Clear();
ISRECDELIM.DataBindings.Add("CHECKED", ComboList, "IS_RECORD_DELIM");
ISFIELDDELIM.DataBindings.Clear();
ISFIELDDELIM.DataBindings.Add("CHECKED", ComboList, "IS_FIELD_DELIM");
ISFLATFILE.DataBindings.Clear();
ISFLATFILE.DataBindings.Add("CHECKED", ComboList, "IS_FLAT");
RECDELIM.DataBindings.Clear();
RECDELIM.DataBindings.Add("TEXT", ComboList, "RECORD_DELIM");
FIELDDELIM.DataBindings.Clear();
FIELDDELIM.DataBindings.Add("TEXT", ComboList, "FIELD_DELIM");
I have a button which is labeled new record, its click event handlers is as follows:
private void button3_Click(object sender, EventArgs e)
{
DataRow r = ComboList.NewRow();
r["ENTRY_NO"] = DBNull.Value;
r["TYPENAME"] = "NEW FILE TYPE";
r["DISPLAYVAL"] = "X: " + r["TYPENAME"].ToString();
ComboList.Rows.Add(r);
}
Code mapped to the datatables.oncolumnchanged event is as follows....
private void UpdateDisplayVal ( Object sender,
DataColumnChangeEventArgs e)
{
if (e.Column.ColumnName == "TYPENAME")
{
e.Row["DISPLAYVAL"] = e.Row["ENTRY_NO"].ToString() + ": " + e.Row["TYPENAME"].ToString();
}
}
The combobox updates with a value "X: NEW FILE TYPE", when i select a new item in it
none of the other bound objects update with the new value, as they do when i selected
the old item.
|
|
|
|
|
Meaning, it won't turn on. Says missing files, when ever file is there.
|
|
|
|
|
Hi,
you should make an effort to be specific.
The exact error message (or number), any extra information (maybe a stack traceback),
other symptoms, all these may help us help you.
Also an exact error message can be typed into Google and point to a solution.
If you're the author of a program that fails without being very specific at it, you should
improve your program by adding:
- checks for success after each system call
- displaying what goes wrong with all available detail
(e.g. GetLastError function)
Without additional information, no one will be able to help you except maybe by wild guessing.
PS: see my second tip below.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I ran into a different way of exiting an application (via the escape key) the other day...
<br />
protected override void KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
if ((int)(byte)e.KeyCode == (int)System.Windows.Forms.Keys.Escape)<br />
{ <br />
Application.Exit();<br />
}<br />
}<br />
What i'm wondering is what does the (byte) do?
The code works with or without it...
I took this code from a DirectX tutorial within the SDK, so I assume whoever wrote it knows what their doing.
Cheers,
Mark.
|
|
|
|
|
Hi Mark,
I'm using .NET 2.0 and KeyPressEventArgs does not have a KeyCode, but the KeyDown and
KeyUp events would offer it.
AFAIK KeyCode returns a Keys value, so you can compare directly, without casting.
The (byte) casting looks like an attempt to mask modifier keys such as SHIFT, ALT, CTRL
but I don't like the way it is done, and I am not sure it is relevant here either.
So I would try a simple if (e.KeyCode==Keys.Escape)...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi
I'm very new to C# and although I have managed to work through creating a simple method for arrays which holds the results of a query with just one return field
I now want to store the results of a query with many records of 15 or more fields and I don't know whether this should be in some kind of array or in a collection, in either case I don't know where to begin. Can anyone help in as simple terms as possible please?
regards
kenwen
|
|
|
|
|
kenwen wrote: Can anyone help in as simple terms as possible please?
That might be difficult, wait.... here try this[^]
|
|
|
|
|
That looks to be the kind of thing I want thanks
|
|
|
|
|
Ummm... wouldn't that be a System.Data.Datatable ?
|
|
|
|
|
Hi,
You may try using ArrayList, the capacity of an ArrayList is the number of elements the list can hold. As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation. The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly. Indexes in this collection are zero-based.
For more information on this you may use visit the following link:
http://msdn2.microsoft.com/en-us/library/system.collections.arraylist(VS.71).aspx[^]
I hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
Hi John,
Sorry for the delay in replying been offline over the weekend.
Just tried the arraylist and it seems to do what I need.
thanks
for your help
regards
Ken Stevens
|
|
|
|
|
hi there still new to c# so forgive this simple question
but is there an operator i can use to perform OR/AND operations on strings
ie
if (currentFd.Name.ToUpper() != "SHAPE" || "FID" || "OID")
{
// do whatever
}
id prefer not to turn this into a case statement and embedded if statements seem pretty ridiculous as well, but i searched around and had no luck finding a solution. anybody out there help?? thanks in advance for helping a newbie
|
|
|
|
|
use the .Equals() method
if(currentFd.Name.ToUpper().Equals("SHAPE") || currentFd.Name.ToUpper().Equals("FID") || currentFd.Name.ToUpper().Equals("OID"))
{
}
...only use cascading if statements if you are really pissed off at your grader
-- modified at 14:39 Thursday 29th November, 2007
"I need build Skynet. Plz send code"
|
|
|
|
|
Alaric_ wrote: == and != can't be applied to strings in that way
What? It's not a problem with the == operator.
|
|
|
|
|
...let me rephrase....(in my opinion) == shouldn't be applied to strings in that way because strings are not actually value types....if you were checking it against null, then "str==null" would be acceptable because you would be comparing whether the value of the reference was equal to null or not. I did not intend to say that "==" and "!=" were causing his problems
...if you want to test whether str is equal to "some string value",
str = "some literal string value";
if(str == "some literal string value"){}
if(str.Equals("some literal string value")){}
the value of the reference to str IS NOT EQUAL to "some literal string value"
but the value stored by str IS EQUAL to "some literal string value"
"I need build Skynet. Plz send code"
|
|
|
|
|
understood..
thanks for clarification
|
|
|
|