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>
>

Reply via email to