Click here to Skip to main content
15,918,108 members
Home / Discussions / Database
   

Database

 
Questionsyntax error! Pin
Jassim Rahma9-Dec-10 2:57
Jassim Rahma9-Dec-10 2:57 
AnswerRe: syntax error! Pin
Pete O'Hanlon9-Dec-10 4:10
mvePete O'Hanlon9-Dec-10 4:10 
AnswerRe: syntax error! Pin
Eddy Vluggen9-Dec-10 5:02
professionalEddy Vluggen9-Dec-10 5:02 
QuestionOPENXML - SQL Pin
Hum Dum8-Dec-10 17:46
Hum Dum8-Dec-10 17:46 
AnswerRe: OPENXML - SQL Pin
Hiren solanki8-Dec-10 22:53
Hiren solanki8-Dec-10 22:53 
QuestionUpdating a DataSet from a Database Pin
Dominick Marciano8-Dec-10 14:07
professionalDominick Marciano8-Dec-10 14:07 
AnswerRe: Updating a DataSet from a Database Pin
PIEBALDconsult8-Dec-10 17:02
mvePIEBALDconsult8-Dec-10 17:02 
AnswerRe: Updating a DataSet from a Database Pin
Mycroft Holmes8-Dec-10 20:17
professionalMycroft Holmes8-Dec-10 20:17 
AnswerRe: Updating a DataSet from a Database Pin
David Mujica9-Dec-10 3:21
David Mujica9-Dec-10 3:21 
AnswerRe: Updating a DataSet from a Database Pin
Vimalsoft(Pty) Ltd9-Dec-10 4:30
professionalVimalsoft(Pty) Ltd9-Dec-10 4:30 
AnswerRe: Updating a DataSet from a Database Pin
Dominick Marciano10-Dec-10 4:25
professionalDominick Marciano10-Dec-10 4:25 
AnswerRe: Updating a DataSet from a Database Pin
Spectre_00114-Dec-10 2:37
Spectre_00114-Dec-10 2:37 
Questiontable physical size [mysql] Pin
Jassim Rahma8-Dec-10 4:08
Jassim Rahma8-Dec-10 4:08 
AnswerRe: table physical size [mysql] Pin
Eddy Vluggen8-Dec-10 4:57
professionalEddy Vluggen8-Dec-10 4:57 
AnswerRe: table physical size [mysql] Pin
PIEBALDconsult8-Dec-10 14:11
mvePIEBALDconsult8-Dec-10 14:11 
Questiondatabase physical size Pin
Jassim Rahma8-Dec-10 3:46
Jassim Rahma8-Dec-10 3:46 
AnswerRe: database physical size Pin
NeverHeardOfMe8-Dec-10 4:07
NeverHeardOfMe8-Dec-10 4:07 
AnswerRe: database physical size Pin
PIEBALDconsult8-Dec-10 14:10
mvePIEBALDconsult8-Dec-10 14:10 
Questionserver properties Pin
Jassim Rahma8-Dec-10 3:46
Jassim Rahma8-Dec-10 3:46 
Questionrun dynamic sql [mysql] Pin
Jassim Rahma8-Dec-10 3:42
Jassim Rahma8-Dec-10 3:42 
AnswerRe: run dynamic sql [mysql] Pin
Chris Meech8-Dec-10 7:38
Chris Meech8-Dec-10 7:38 
AnswerRe: run dynamic sql [mysql] Pin
RyanEK8-Dec-10 14:30
RyanEK8-Dec-10 14:30 
AnswerRe: run dynamic sql [mysql] Pin
Hiren solanki8-Dec-10 23:13
Hiren solanki8-Dec-10 23:13 
AnswerRe: run dynamic sql [mysql] Pin
RaviRanjanKr12-Dec-10 3:33
professionalRaviRanjanKr12-Dec-10 3:33 
GeneralRe: run dynamic sql [mysql] Pin
Jassim Rahma18-Dec-10 2:19
Jassim Rahma18-Dec-10 2:19 
Hi,

I tried it and it's working BUT it's just executing the first query so f i type any other quesry it will just show the first query result with no error unless i signout my application or restart it.. why is this?

here is the code:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel runat="server" ID="panelError" BorderWidth="1" BorderColor="Red" style="padding:10px" Visible="false" BorderStyle="Solid" HorizontalAlign="Left">
    <dxe:ASPxLabel ID="lblErrorTitle" runat="server" Text="Error" Font-Bold="true" ForeColor="Red" /><br /><br />
    <dxe:ASPxLabel ID="lblErrorDetails" runat="server" Text="" />
</asp:Panel>
<dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0" Height="250px" Width="100%">
    <TabPages>
        <dxtc:TabPage Text="Query Editor" TabStyle-HorizontalAlign="Center" TabStyle-VerticalAlign="Middle">
            <Controls>
                <dxe:ASPxMemo ID="txtQuery" runat="server" Height="200px" Width="100%" /><br /><br />
                <asp:Button runat="server" ID="btnExecute" Width="100px" Text="Execute" OnClick="btnExecute_Click" />
            </Controls>
        </dxtc:TabPage>
    </TabPages>
</dxtc:ASPxPageControl>
<br /><br />
<dxwgv:ASPxGridView ID="gridQuery" runat="server" AutoGenerateColumns="True" 
    CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" CssPostfix="PlasticBlue" 
    Width="100%">
    <Columns />
    <Images ImageFolder="~/App_Themes/Plastic Blue/{0}/">
        <CollapsedButton Height="9px" 
            Url="~/App_Themes/Plastic Blue/GridView/gvCollapsedButton.png" Width="9px" />
        <ExpandedButton Height="9px" 
            Url="~/App_Themes/Plastic Blue/GridView/gvExpandedButton.png" Width="9px" />
        <HeaderSortDown Height="11px" 
            Url="~/App_Themes/Plastic Blue/GridView/gvHeaderSortDown.png" Width="11px" />
        <HeaderSortUp Height="11px" 
            Url="~/App_Themes/Plastic Blue/GridView/gvHeaderSortUp.png" Width="11px" />
    </Images>
    <SettingsPager ShowDefaultImages="False" PageSize="30">
        <AllButton Text="All">
        </AllButton>
        <NextPageButton Text="Next &gt;">
        </NextPageButton>
        <PrevPageButton Text="&lt; Prev">
        </PrevPageButton>
    </SettingsPager>
    <Styles CssFilePath="~/App_Themes/Plastic Blue/{0}/styles.css" 
        CssPostfix="PlasticBlue">
        <Header ImageSpacing="10px" SortingImageSpacing="10px">
        </Header>
    </Styles>
    <SettingsBehavior AllowDragDrop="False" AllowGroup="False" />
</dxwgv:ASPxGridView>
</ContentTemplate>
</asp:UpdatePanel>


and here is the background code:
try
{
    data_table = new DataTable();
    
    string sql_statement = "SQL" + DateTime.Now.ToString("ddMMMyyyyHHmmss");

    sql_connection = new MySqlConnection((string)Session["connection_string"]);
    sql_connection.Open();
    sql_command = new MySqlCommand("PREPARE " + sql_statement + " FROM '" + txtQuery.Text + "'; EXECUTE " + sql_statement + "; DROP PREPARE " + sql_statement + ";", sql_connection);
    sql_command.CommandType = CommandType.Text;
    sql_adapter = new MySqlDataAdapter(sql_command);
    sql_adapter.Fill(data_table);
    gridQuery.DataSource = data_table;
    gridQuery.DataBind();
}
catch (MySqlException exp)
{
    lblErrorDetails.Text = exp.Message;
    panelError.Visible = true;
    return;
}
finally
{
    if (sql_reader != null) sql_reader.Close();
    if (sql_connection != null)
    {
        if (sql_connection.State == ConnectionState.Open)
            sql_connection.Close();
    }
}

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.