Click here to Skip to main content
15,889,739 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Persist a controls view state in masterpage Pin
r a m e s h11-Sep-09 3:22
r a m e s h11-Sep-09 3:22 
QuestionNeed to delete row in gridview but must not affect that row in the database. Pin
renoma11-Sep-09 2:10
renoma11-Sep-09 2:10 
AnswerRe: Need to delete row in gridview but must not affect that row in the database. Pin
Meetu Choudhary11-Sep-09 2:17
Meetu Choudhary11-Sep-09 2:17 
AnswerRe: Need to delete row in gridview but must not affect that row in the database. Pin
Md. Marufuzzaman11-Sep-09 4:17
professionalMd. Marufuzzaman11-Sep-09 4:17 
QuestionRemove items from generic list Pin
yesu prakash11-Sep-09 1:52
yesu prakash11-Sep-09 1:52 
AnswerRe: Remove items from generic list Pin
sashidhar11-Sep-09 1:57
sashidhar11-Sep-09 1:57 
AnswerRe: Remove items from generic list Pin
N a v a n e e t h11-Sep-09 2:43
N a v a n e e t h11-Sep-09 2:43 
Questionerror Pin
ankitjain111011-Sep-09 1:26
ankitjain111011-Sep-09 1:26 
string connection2 = ConfigurationManager.AppSettings["conn"];
OleDbConnection con2 = new OleDbConnection(connection2);
string connectionString = ConfigurationManager.AppSettings["conn"];

if(DropDownList1.SelectedItem.ToString()=="ALL")
{
string query = "select * from appointment where DATE > @StartDate and DATE < @EndDate ";
}
else
{
string query = "select * from appointment where DATE > @StartDate and DATE < @EndDate and DOCTOR_NAME='"+DropDownList1.SelectedItem.ToString()+"'";
}
// wrap the connection and command in using block to avoid resource leaks.
using (OleDbConnection connection = new OleDbConnection(connectionString))
using (OleDbCommand command = new OleDbCommand(query, connection))
{
command.Parameters.AddWithValue("@StartDate", sel.ToShortDateString());
command.Parameters.AddWithValue("@EndDate", tmp.ToShortDateString());

connection.Open();
// using a reader. You don't need a dataset as you are not persisting it in memory
using (OleDbDataReader reader = command.ExecuteReader())
{
GridView1.DataSource = reader;
GridView1.DataBind();
}
connection.Close();
}
}

its showing an error like
Error 1 The name 'query' does not exist in the current context C:\Users\Ankit\Documents\Visual Studio 2005\WebSites\WebSite1\Default.aspx.cs 53 56 C:\...\WebSite1\

can anyone help
AnswerRe: error Pin
Meetu Choudhary11-Sep-09 1:32
Meetu Choudhary11-Sep-09 1:32 
GeneralRe: error Pin
ankitjain111011-Sep-09 1:34
ankitjain111011-Sep-09 1:34 
AnswerRe: error Pin
Meetu Choudhary11-Sep-09 1:33
Meetu Choudhary11-Sep-09 1:33 
GeneralRe: error Pin
ankitjain111011-Sep-09 1:37
ankitjain111011-Sep-09 1:37 
AnswerRe: error Pin
Jay Royall11-Sep-09 1:34
Jay Royall11-Sep-09 1:34 
AnswerRe: error Pin
J4amieC11-Sep-09 3:35
J4amieC11-Sep-09 3:35 
Questionvisibility false of a column in gridview Pin
shankbond11-Sep-09 1:02
shankbond11-Sep-09 1:02 
AnswerRe: visibility false of a column in gridview Pin
Meetu Choudhary11-Sep-09 1:29
Meetu Choudhary11-Sep-09 1:29 
GeneralRe: visibility false of a column in gridview Pin
shankbond11-Sep-09 1:58
shankbond11-Sep-09 1:58 
AnswerRe: visibility false of a column in gridview Pin
Meetu Choudhary11-Sep-09 2:02
Meetu Choudhary11-Sep-09 2:02 
RantRe: visibility false of a column in gridview Pin
shankbond11-Sep-09 2:59
shankbond11-Sep-09 2:59 
GeneralRe: visibility false of a column in gridview Pin
Meetu Choudhary11-Sep-09 3:02
Meetu Choudhary11-Sep-09 3:02 
QuestionProblem With Web service Pin
prabhakar dwivedi10-Sep-09 23:03
prabhakar dwivedi10-Sep-09 23:03 
AnswerRe: Problem With Web service Pin
SeMartens10-Sep-09 23:11
SeMartens10-Sep-09 23:11 
GeneralRe: Problem With Web service Pin
prabhakar dwivedi10-Sep-09 23:25
prabhakar dwivedi10-Sep-09 23:25 
GeneralRe: Problem With Web service Pin
SeMartens11-Sep-09 0:22
SeMartens11-Sep-09 0:22 
QuestionSuggestions for displaying search results like Google? Pin
W4Rl0CK4710-Sep-09 23:00
W4Rl0CK4710-Sep-09 23:00 

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.