Click here to Skip to main content
15,922,512 members
Home / Discussions / Database
   

Database

 
AnswerRe: Remote accessing of reportserver using SSRS 2005 Pin
pmarfleet15-Nov-07 6:24
pmarfleet15-Nov-07 6:24 
GeneralRe: Remote accessing of reportserver using SSRS 2005 [modified] Pin
MSinha15-Nov-07 18:31
MSinha15-Nov-07 18:31 
GeneralRe: Remote accessing of reportserver using SSRS 2005 [modified] Pin
MSinha16-Nov-07 3:12
MSinha16-Nov-07 3:12 
QuestionDecimal vs Money Pin
Brendan Vogt15-Nov-07 4:04
Brendan Vogt15-Nov-07 4:04 
AnswerRe: Decimal vs Money Pin
Rob Philpott15-Nov-07 4:40
Rob Philpott15-Nov-07 4:40 
Questionfind percentage of perticular fields of two columns in sqlserver2005 Pin
subbu.sk15-Nov-07 3:24
subbu.sk15-Nov-07 3:24 
AnswerRe: find percentage of perticular fields of two columns in sqlserver2005 Pin
Pete O'Hanlon15-Nov-07 3:52
mvePete O'Hanlon15-Nov-07 3:52 
QuestionCreating a dynamic sql dataset without needing to postback Pin
kosh205915-Nov-07 3:23
kosh205915-Nov-07 3:23 
Hi,

i'm a beginner in asp.net programming and web for that matter,
and in need of some help.

i use an unknown amout of tables that i need to view, lets assume the connection string and select query are entered by the user.

i need in the page_load or somewhere to create a dataset and set the gridview to it. the grid view is a static control on the web form.

now i am using:

protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("con str");
SqlDataAdapter ad = new SqlDataAdapter("select str", con);
DataSet ds = new DataSet();
ad.Fill(ds, "test");
con.Close();

this.Controls.Add(data);
theGrid.DataSourceID = data.ID;
theGrid.DataSource = ds;
theGrid.DataBind();
}

this works, but each click/change that causes a postback will call page_loaf again. i tried to define the ds variable as private var of the class, and then put the 3 first lines in an if (!postback) {...} statment.
didn't work, the vars are recreated on each post back.

what is the solution for this?
how can i create a grid that will be saved without re binding it?
(and if i don't add the ds to the form as a control, it just doesn't bind)

help!!!

thanks, koren.

kosh2059

Answerplease ignore/delete this question, moved to web dev Pin
kosh205915-Nov-07 3:36
kosh205915-Nov-07 3:36 
QuestionCant save strings longer 255 in Excel (via ODBC) Pin
manolain15-Nov-07 1:47
manolain15-Nov-07 1:47 
AnswerRe: Cant save strings longer 255 in Excel (via ODBC) Pin
pmarfleet15-Nov-07 1:58
pmarfleet15-Nov-07 1:58 
Questioncopying a tuple field to another Pin
sindhutiwari14-Nov-07 23:11
sindhutiwari14-Nov-07 23:11 
AnswerRe: copying a tuple field to another Pin
pmarfleet15-Nov-07 0:54
pmarfleet15-Nov-07 0:54 
QuestionProblem while inserting into a database,whilst using BindingSource. Pin
siddy1714-Nov-07 23:04
siddy1714-Nov-07 23:04 
QuestionSQL Injection Pin
Shajeel14-Nov-07 18:26
Shajeel14-Nov-07 18:26 
AnswerRe: SQL Injection Pin
Expert Coming14-Nov-07 20:15
Expert Coming14-Nov-07 20:15 
GeneralRe: SQL Injection Pin
Shajeel14-Nov-07 21:19
Shajeel14-Nov-07 21:19 
AnswerRe: SQL Injection Pin
N a v a n e e t h14-Nov-07 21:46
N a v a n e e t h14-Nov-07 21:46 
GeneralRe: SQL Injection Pin
Shajeel14-Nov-07 21:56
Shajeel14-Nov-07 21:56 
GeneralRe: SQL Injection Pin
Pete O'Hanlon15-Nov-07 0:00
mvePete O'Hanlon15-Nov-07 0:00 
GeneralRe: SQL Injection Pin
Colin Angus Mackay15-Nov-07 0:01
Colin Angus Mackay15-Nov-07 0:01 
GeneralRe: SQL Injection Pin
Vasudevan Deepak Kumar15-Nov-07 4:50
Vasudevan Deepak Kumar15-Nov-07 4:50 
GeneralRe: SQL Injection Pin
DQNOK15-Nov-07 9:56
professionalDQNOK15-Nov-07 9:56 
QuestionCompressing an MS SQL Server 2005 database Pin
Steven J Jowett14-Nov-07 6:39
Steven J Jowett14-Nov-07 6:39 
AnswerRe: Compressing an MS SQL Server 2005 database Pin
Hesham Amin14-Nov-07 8:22
Hesham Amin14-Nov-07 8:22 

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.