Advertisement
ASP_Volume2 Miscellaneous #43024

Clear CMOS Memory

Clear contents of CMOS Memory

AI

KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Quellcode
original-source
Upload
<size="12px">1. Create a sqlConnection to your database using the sqlConnection tool in your tool box. Name it sqlMyCon
<BR><BR>
2. Create a sql command using the sqlCommand tool in your toolbox that will query and return a row that you are wanting. Name it sqlMyCmd. In this case I am wanting to return a specific row so I would do something like this:<BR><BR>
<color="#0000FF">
SELECT * FROM MyTable<BR>
WHERE (ColumnName = '1234567')<BR>
</color>
That would return all the columns in the the table "MyTable". Where there was a row in the Column "ColumnName" that has the integer "1234567" in it.
<BR><BR>
3. Now you have done with that you get to write a few lines of code. So here is the example of how I would go about reading the data that is returned and inserting it into a web page or application. (Pretend I have a label named "lblData")<BR><BR><BR>
<color="#0088FF">
sqlMyCon.Open();<BR>
</color><color="#3CF13C">
// This creates a datareader<BR>
</color><color="#0088FF">
SqlDataReader reader = sqlMyCmd.ExecuteReader();<BR>
reader.Read();<BR>
</color><color="#3CF13C">
//This will select what column's data it will<BR>
// return using "GetString" remember it is zerobased<br>
</color><color="#0088FF">
lblData.Text = reader.GetString(2);<Br>
sqlMyCon.Close();<br>
</color>
<Br><br>
4. Run it and make sure it works. If you would like to see something that uses that and does work go to http://www.junebughunter.net I made that site and all the content comes from a database using almost that exact same thing.
</size>
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine