yep,
that and you only need to select the columns that you need rather than
everything from the table. Using * will leave you open to SQL injections.
try w3schools.com or codeproject for a working example of what you are
trying to accomplish. The MSDN library is not a bad option either

On Fri, Feb 12, 2010 at 10:01 AM, Processor Devil <processor.de...@gmail.com
> wrote:

> man, do you see that string saying "SELECT * FROM clients where id='02'"?
> Guess what, that SELECT is MySQL command...
> INSERT command is to insert data into MySQL table...
> I suggest you to search google for "MySQL INSERT".
>
> 2010/2/12 stephan king <mcgiver...@gmail.com>
>
> yeah , I tried google ,found an exemple to get data from the DB , but
>> Ididn't found how to insert data into the DB
>>
>>
>> *my working example:*
>>
>>  <%@ Page CompilerOptions='/R:"C:\Program
>> Files\Microsoft.NET\Odbc.Net\Microsoft.data.odbc.dll"'%>
>> <%@ Import Namespace="System.Data" %>
>> <%@ Import Namespace="Microsoft.Data.Odbc" %>
>> <HTML>
>> <HEAD><title>Last one</title>
>> <SCRIPT Language="VB" Runat="server">
>> Sub Page_Load(Source as object, e as EventArgs)
>> Dim sConString As String = "DRIVER={MySQL ODBC 5.1 Driver};
>> SERVER=localhost; DATABASE=test; UID=root; PASSWORD=root; OPTION=3"
>> Dim oConnection as ODBCConnection = new ODBCConnection(sConString)
>>
>> Dim sSQL as String = "SELECT * FROM clients where id='02'"
>> Dim oDataAdapter as ODBCDataAdapter = New ODBCDataAdapter(sSQL,
>> oConnection)
>> Dim oDataSet as DataSet = new DataSet()
>> oDataAdapter.Fill(oDataSet)
>> oDataGrid.DataSource = oDataSet
>> oDataGrid.DataBind()
>> End Sub
>> </SCRIPT >
>> </HEAD>
>> <BODY>
>> <ASP:DataGrid ID="oDataGrid" Runat="server" />
>> <br /> <H2>ouff !! it works</H2>
>> </BODY>
>> </HTML>
>>
>
>


-- 
Keidrick Pettaway

http://kpettaway.com

Reply via email to