Set Conn = Server.CreateObject("ADODB.connection") ConnStr= "Driver=Microsoft Visual Foxpro Driver; UID=;SourceType=DBC;SourceDB=C:\csharp\Data\pma.dbc" Conn.Open ConnStr 'This can be a datasource name or a connect string Set cmdTemp = Server.CreateObject("ADODB.Command") Set rs = Server.CreateObject("ADODB.Recordset") SQLText="Select pibase.street,pibase.from,pibase.to from pma!pibase" cmdTemp.CommandText = SQLText cmdTemp.CommandType = 1 'SQL statement Set cmdTemp.ActiveConnection = Conn rs.CacheSize = 10 rs.Open cmdTemp,,adopenstaticHowever, the ASP.NET sample doesn't do it this way and it load a DataGrid using a DataSet. The C# code seems to be so much "easier" and uses less lines of code as shown below:
<%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> protected void Page_Load(Object sender, EventArgs e) { SqlConnection sqlconnectionPubs = new SqlConnection("server=(local)\\NetSDK;uid=QSUser;pwd=QSPassword;database=pubs"); SqlDataAdapter sqldataadapterTitles = new SqlDataAdapter("select title, notes, price from titles where type='business'", sqlconnectionPubs); DataSet datasetTitles = new DataSet(); sqldataadapterTitles.Fill(datasetTitles, "titles"); datagridTitles.DataSource=datasetTitles.Tables["titles"].DefaultView; datagridTitles.DataBind(); } </SCRIPT>All comments and suggestions are greatly appreciated.