Click here to Skip to main content
15,896,557 members
Home / Discussions / Database
   

Database

 
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();
    }
}

Questioncurrent server Pin
Jassim Rahma8-Dec-10 3:33
Jassim Rahma8-Dec-10 3:33 
AnswerRe: current server Pin
PIEBALDconsult8-Dec-10 14:10
mvePIEBALDconsult8-Dec-10 14:10 
Questionget server default collation ad character set Pin
Jassim Rahma8-Dec-10 3:32
Jassim Rahma8-Dec-10 3:32 
AnswerRe: get server default collation ad character set Pin
Hiren solanki8-Dec-10 23:18
Hiren solanki8-Dec-10 23:18 
Questionbig deletes transaction log full Pin
devvvy6-Dec-10 20:33
devvvy6-Dec-10 20:33 
AnswerRe: big deletes transaction log full Pin
Luc Pattyn6-Dec-10 21:00
sitebuilderLuc Pattyn6-Dec-10 21:00 
AnswerRe: big deletes transaction log full Pin
David Mujica7-Dec-10 3:45
David Mujica7-Dec-10 3:45 
AnswerRe: big deletes transaction log full Pin
Mycroft Holmes7-Dec-10 11:23
professionalMycroft Holmes7-Dec-10 11:23 
QuestionPassing values to a stored proc Pin
tasumisra6-Dec-10 3:59
tasumisra6-Dec-10 3:59 
AnswerRe: Passing values to a stored proc Pin
Erdinc276-Dec-10 4:50
Erdinc276-Dec-10 4:50 
GeneralRe: Passing values to a stored proc Pin
tasumisra6-Dec-10 5:13
tasumisra6-Dec-10 5:13 
GeneralRe: Passing values to a stored proc Pin
jschell6-Dec-10 11:57
jschell6-Dec-10 11:57 
AnswerRe: Passing values to a stored proc Pin
Mycroft Holmes6-Dec-10 13:27
professionalMycroft Holmes6-Dec-10 13:27 
GeneralRe: Passing values to a stored proc Pin
PIEBALDconsult6-Dec-10 14:43
mvePIEBALDconsult6-Dec-10 14:43 
GeneralRe: Passing values to a stored proc Pin
Mycroft Holmes6-Dec-10 15:19
professionalMycroft Holmes6-Dec-10 15:19 
GeneralRe: Passing values to a stored proc Pin
Jörgen Andersson6-Dec-10 20:13
professionalJörgen Andersson6-Dec-10 20:13 
Questionadding Group by result to each other Pin
Erdinc276-Dec-10 1:50
Erdinc276-Dec-10 1:50 

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.