char[] sSeparators = { ',', ' ' };
string[] sStocks = txtStocks.Text.Split(sSeparators);
SqlConnection conn = new SqlConnection("AttachDbFilename=|DataDirectory|\\ASPNETDB.MDF;User Instance=True;Data Source=.\\SQLEXPRESS;Integrated Security=True;");
System.Data.SqlClient.SqlCommand command = new System.Data.SqlClient.SqlCommand("sproc_aspnet_CreateStockInList", conn);
command.CommandType = System.Data.CommandType.StoredProcedure;
conn.Open();
foreach (string _stock in sStocks)
{
command.Parameters.AddWithValue("@ListId", txtListId.Text.Trim());
command.Parameters.AddWithValue("@Symbol", _stock.Trim());
command.ExecuteNonQuery();
command.Parameters.Clear();
}
conn.Close();
Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.
Thursday, September 13, 2007
C# to run stored procedure after parsing text
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(41)
-
▼
September
(13)
- Connecting to Kensoft.net SQL Server 2005 database
- Copying a MDF SQLExpress Database file to SQL Serv...
- Building an AJAX Slide Show in ASP.net
- Proper ViewState use and the coalescing operator
- GridView table headers and iterating over a GridVi...
- DataGridView cell contents and header contents
- HTML Table header accessibility standards
- C# switch statement for DropDownList to update Ima...
- Using XPath for reading attribute and content of XML
- Nested GridView with subtotals, totals, and counts
- Modifying the contents of a GridView after DataBin...
- Highlight search text functions using css tags and...
- C# to run stored procedure after parsing text
-
▼
September
(13)
No comments:
Post a Comment