vortex Posted March 4, 2008 Posted March 4, 2008 Hi guys,Need your help here, im a begginer in .net programming.I have a table that contains only one row of data.this is the table script:CREATE TABLE `tblsiteconfig` ( `uscfid` int(1) AUTO_INCREMENT NOT NULL COMMENT 'Unique site config key value', `sitetitle` varchar(50) NOT NULL COMMENT 'Website title', `sitedescription` varchar(100) NOT NULL COMMENT 'Website description for meta tag generation', `sitekeywords` varchar(200) NOT NULL COMMENT 'Website keywords for meta tag generations for search engine indexing', `sitecopyright` varchar(200) NOT NULL COMMENT 'Website copyright notice to be displayed at the footer of every page', `siteadminemail` varchar(50) NOT NULL COMMENT 'Website webmaster email', `sitetelephone` varchar(20) NOT NULL COMMENT 'Website telephone number', `sitemaintenance` tinyint(1) COMMENT 'Website maintenance status', `sitenews` tinyint(1) COMMENT 'Enable/Disable site news', `sitepoll` tinyint(1) COMMENT 'Enable/Disable site poll', /* Keys */ PRIMARY KEY (`uscfid`)) ENGINE = InnoDB COMMENT = 'Table containg basic site configuration parameter';now, i can get the data to be displayed if i use these codes:Imports System.DataImports System.Data.Odbc Protected Sub btnConnectMYSQL_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnConnectMYSQL.Click Dim myConnection As OdbcConnection = New OdbcConnection(ConfigurationManager.ConnectionStrings("MYSQLDBCON").ConnectionString) Dim sSQL As String = "select * from tblsiteconfig where uscfid=1" Dim oDataAdapter As OdbcDataAdapter = New OdbcDataAdapter(sSQL, myConnection) Dim oDataSet As DataSet = New DataSet() oDataAdapter.Fill(oDataSet) grdDisplayData.DataSource = oDataSet grdDisplayData.DataBind() End SubThis populates the whole data into a grid. but, how can i change the code above so that i can assign individual value to a text box?eg: txtsitetitle.text = [sitetitle from database]Thanks in advance.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now