Click here to Skip to main content
15,939,960 members
Home / Discussions / C#
   

C#

 
GeneralI don't believe this is the case Pin
gekoscan18-Jan-04 22:11
gekoscan18-Jan-04 22:11 
GeneralRe: I don't believe this is the case Pin
Duncan Edwards Jones19-Jan-04 1:55
professionalDuncan Edwards Jones19-Jan-04 1:55 
GeneralPreview of custom file type Pin
Shree18-Jan-04 20:54
Shree18-Jan-04 20:54 
GeneralRe: Preview of custom file type Pin
Heath Stewart19-Jan-04 3:51
protectorHeath Stewart19-Jan-04 3:51 
Generalseparated from its underlying RCW when accessing a chat frame. Pin
Andrlage18-Jan-04 11:00
Andrlage18-Jan-04 11:00 
GeneralPersist data across pages using Web Table Control Pin
caheo18-Jan-04 10:19
caheo18-Jan-04 10:19 
GeneralRe: Persist data across pages using Web Table Control Pin
Mazdak18-Jan-04 10:32
Mazdak18-Jan-04 10:32 
GeneralRe: Persist data across pages using Web Table Control Pin
Heath Stewart18-Jan-04 12:01
protectorHeath Stewart18-Jan-04 12:01 
Set EnableViewState to true and in the server event handler for the "Save" button (or whatever you call it), gather the values from each TextBox and save them to a database using ADO.NET. Search the CodeProject web site for examples. There's also several examples of inserting data into a database from ASP.NET using ADO.NET. For example, if you have a couple TextBoxes on the page and a button with the Client event handler save_Click, you could do something like the following:
private void save_Click(object sender, EventArgs e)
{
  if (!IsValid) return;
  SqlConnection conn = new SqlConnection("...");
  SqlCommand cmd = conn.CreateCommand();
  cmd.CommentText = "INSERT INTO Table1 (FirstName, LastName) " +
    "VALUES (@FirstName, @LastName)";
  cmd.Parameters.Add("@FirstName", SqlDbType.NVarChar, 40).Value = textBox1.Text;
  cmd.Parameters.Add("@LastName", SqlDbType.NVarChar, 40).Value = textBox2.Text;
  try
  {
    conn.Open();
    cmd.ExecuteNonQuery();
  }
  catch (Exception e)
  {
    // Method to display error to user and perhaps log.
    DisplayError(e.Message);
  }
  finally
  {
    conn.Close();
  }
}


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: Persist data across pages using Web Table Control Pin
caheo18-Jan-04 13:55
caheo18-Jan-04 13:55 
GeneralRe: Persist data across pages using Web Table Control Pin
Heath Stewart19-Jan-04 3:00
protectorHeath Stewart19-Jan-04 3:00 
GeneralAdded method with a wizard Pin
Anonymous18-Jan-04 10:06
Anonymous18-Jan-04 10:06 
GeneralRe: Added method with a wizard Pin
Mazdak18-Jan-04 10:19
Mazdak18-Jan-04 10:19 
GeneralRe: Added method with a wizard Pin
leppie18-Jan-04 11:35
leppie18-Jan-04 11:35 
GeneralRe: Added method with a wizard Pin
Mazdak18-Jan-04 20:12
Mazdak18-Jan-04 20:12 
GeneralRe: Added method with a wizard Pin
Guillermo Rivero18-Jan-04 10:32
Guillermo Rivero18-Jan-04 10:32 
GeneralC# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 7:05
Orahn18-Jan-04 7:05 
GeneralRe: C# - Multidimensionnal array of pointers Pin
leppie18-Jan-04 10:04
leppie18-Jan-04 10:04 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 10:09
Orahn18-Jan-04 10:09 
GeneralRe: C# - Multidimensionnal array of pointers Pin
leppie18-Jan-04 10:13
leppie18-Jan-04 10:13 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Heath Stewart18-Jan-04 11:49
protectorHeath Stewart18-Jan-04 11:49 
GeneralRe: C# - Multidimensionnal array of pointers Pin
Orahn18-Jan-04 18:58
Orahn18-Jan-04 18:58 
GeneralRe: C# - Multidimensionnal array of pointers Pin
pat2918-Jan-04 18:58
pat2918-Jan-04 18:58 
GeneralExecuteNonQuery() problem in C# Pin
Qamarwis18-Jan-04 5:10
Qamarwis18-Jan-04 5:10 
GeneralRe: ExecuteNonQuery() problem in C# Pin
Nick Parker18-Jan-04 5:39
protectorNick Parker18-Jan-04 5:39 
GeneralRe: ExecuteNonQuery() problem in C# Pin
Guillermo Rivero18-Jan-04 6:58
Guillermo Rivero18-Jan-04 6:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.