Hallo, 

hier ein Beispiel: 

public void ChangeMessage(sting page, string message)
{
// Create an instance of connection and command object
SqlConnection myConnection = new SpqConnection(myConnectionString);
// Verbindung zur Datenbank herstellen mit Übergabe des Names der
Procedure
SqlCommand myCommand = new SqlCommand("ChangeMessageText",
myConnection);
// Mark the command as stored procedure
myCommand.CommandType = CommandType.StoredProcedure;
// Add Parameters to the stored procedure
SqlParamter parameterPage = new SqlParamter("@Page",
SqpDBType.NVarChar, 50);
parameterPage.Value = page;
myCommand.Parameters.Add(parameterPage);
SqlParamter parameterMessage = new SqlParamter("@Message",
SqpDBType.NVarChar, 50);
parameterMessage.Value = message;
myCommand.Parameters.Add(parameterMessage);

try
{
// Open the Connection and execute the Command
myConnection.Open();
myCommand.ExecuteNonQuery();
}
catch (SqlException ex) { ... }
finally { myConnection.Close(); }
} // end ChangeMessage


Gruß

Bernhard

---- Original Message ----
Von: [EMAIL PROTECTED]
An: [email protected], 
Betreff: RE: [Asp.net] ASP .Net --> Stored Procedure
Datum: Wed, 20 Jul 2005 09:14:37 +0200 (MEST)

>Hallo,
>
>ich möchte aus meiner ASP .Net Applikation eine "Stored Procedure" 
>auf einer
>MS SQL Datenbank aufrufen und dieser noch Parameter übergeben.
>
>Hat da jemaned erfahrung mit, bzw. kann mir sagen wie ich das am 
>besten
>mache ?
>
>Vielen Dank im voraus.
>
>_______________________________________________
>Asp.net Mailingliste, Postings senden an:
>[email protected]
>An-/Abmeldung und Suchfunktion unter:
>http://www.glengamoi.com/mailman/listinfo/asp.net
>
>

_______________________________________________
Asp.net Mailingliste, Postings senden an:
[email protected]
An-/Abmeldung und Suchfunktion unter:
http://www.glengamoi.com/mailman/listinfo/asp.net

Antwort per Email an