Help! I have limited SQL experience from the days when FoxPro was used for DOS and Windows 3.1! So, I have copied an SQL example code from a book and I've made a few modifications. I'd like to have two main qiestions answered. 1 - Will this code work in .Net 3.5? 2 - How could this SQL code be optimized? Here's the code: --------------- Friend Sub SaveStatistics() ' This routine will store the stock symbol & closing price in SQL format. ' An ASP.Net program will retrieve SQL file for display. Dim ConnectionString As String '= This will be designed with .Net Wizard. Dim Con_StockDB As New SqlClient.SqlConnection(ConnectionString) Con_StockDB.Open() Dim SQL_CMD As New SqlClient.SqlCommand _ ("INSERT INTO Stock_Status " & "VALUES (?, ?)", Con_StockDB) For LIndex = 1 To (G_NIP - G_MissingStock) SQL_CMD.Parameters.Add(New SqlClient.SqlParameter _ ("Symbol", G_StockSymbol(LIndex))) SqlClient.SqlParameter("ClosePrice", G_Stock(L_StockIndex).ClosePrice)) Try SQL_CMD.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try Next LIndex Con_StockDB.Close() Con_StockDB.Dispose() End Sub
1. Yes mostly it will work.. 2. i think this code does not needed to optimize.. correct me if i am wrong.. btw y ru using ("INSERT INTO Stock_Status " & "VALUES (?, ?)", Con_StockDB) ?? ("INSERT INTO Stock_Status VALUES (?, ?)", Con_StockDB) this will work..
Thanks "AnAnonymous Surf" for referring me to that website! http://www.4guysfromrolla.com/articles/022206-1.aspx I haven't yet read through what I've printed, but it looks VERY promising! May you have a blessed day as the Lord wills. JEP_Dude