Click here to Skip to main content
15,913,944 members
Home / Discussions / C#
   

C#

 
QuestionKeyEventArgs.SuppressKeyPress in C# Pin
ArunJoseph 47163951-Jul-08 12:28
ArunJoseph 47163951-Jul-08 12:28 
AnswerRe: KeyEventArgs.SuppressKeyPress in C# Pin
User 66581-Jul-08 12:36
User 66581-Jul-08 12:36 
GeneralRe: KeyEventArgs.SuppressKeyPress in C# Pin
ArunJoseph 47163951-Jul-08 20:51
ArunJoseph 47163951-Jul-08 20:51 
GeneralRe: KeyEventArgs.SuppressKeyPress in C# Pin
N a v a n e e t h1-Jul-08 21:02
N a v a n e e t h1-Jul-08 21:02 
GeneralRe: KeyEventArgs.SuppressKeyPress in C# Pin
ArunJoseph 47163951-Jul-08 22:06
ArunJoseph 47163951-Jul-08 22:06 
AnswerRe: KeyEventArgs.SuppressKeyPress in C# Pin
Luc Pattyn1-Jul-08 14:23
sitebuilderLuc Pattyn1-Jul-08 14:23 
GeneralRe: KeyEventArgs.SuppressKeyPress in C# Pin
ArunJoseph 47163951-Jul-08 20:57
ArunJoseph 47163951-Jul-08 20:57 
QuestionNested Datalist Selection sometimes fails when large data or clicking to fast -- Guessing Timeout ?? Ideas??? Going Crazy! Pin
Natalia_Uribe1-Jul-08 11:46
Natalia_Uribe1-Jul-08 11:46 
I have a user control that has 2 nested datalists. The second datalist requieres arguments from the first one to display the data. The main one shows the Product Categories and the second one shows the products for the selected category. When the user selects an item from the first I am calling "DataList_ItemCommand" which sets a session variable and then programatically binds the data for the second datalist. SOMETIMES (Mostly when the results are big or if I click to fast) I get an error on Internet Explorer which forces me to refresh the screen to see the data... Any ideas on what could be happening? Solutions?? Thanks Guys!

public void DataList_ItemCommand(Object sender, DataListCommandEventArgs e)
{
decimal nCpPk = (decimal)CategoryList.DataKeys[e.Item.ItemIndex];
Session["CategoryId"] = nCpPk;

BindData();
}

public void BindData()
{
//Dataset
DataSet DS = new DataSet();

//Create a connection to the SQL Server.
string strConnectionString = ConfigurationManager.ConnectionStrings["EckeMasterConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(strConnectionString);

//Session Variables
decimal tmpCategoryId = (decimal)Session["CategoryId"];
decimal tmpMainCateg = (decimal)Session["MainCateg"];
string tmpShipWeek = (string)Session["ShipWeek"];
int tmpAvailableOnly = (int)Session["AvailableOnly"];
string tmpProdForm = (string)Session["ProdForm"];

//Create a DataAdapter, and then provide the name of the stored procedure.
SqlDataAdapter MyDataAdapter1 = new SqlDataAdapter("EWO_ProductsByCategory", conn);
MyDataAdapter1.SelectCommand.CommandType = CommandType.StoredProcedure;

SqlParameter ParCateg = new SqlParameter("@CategoryId", SqlDbType.Int);
ParCateg.Value = tmpCategoryId;
MyDataAdapter1.SelectCommand.Parameters.Add(ParCateg);

SqlParameter ParMainCateg = new SqlParameter("@MainCateg", SqlDbType.Int);
ParMainCateg.Value = tmpMainCateg;
MyDataAdapter1.SelectCommand.Parameters.Add(ParMainCateg);

SqlParameter ParProdForm = new SqlParameter("@ProdForm", SqlDbType.Int);
ParProdForm.Value = tmpProdForm;
MyDataAdapter1.SelectCommand.Parameters.Add(ParProdForm);

MyDataAdapter1.SelectCommand.CommandTimeout = int.MaxValue;
MyDataAdapter1.Fill(DS, "Products");

//'Create a DataAdapter, and then provide the name of the stored procedure.
SqlDataAdapter MyDataAdapter2 = new SqlDataAdapter("EWO_ProductDetail", conn);
MyDataAdapter2.SelectCommand.CommandType = CommandType.StoredProcedure;

SqlParameter ParCategA = new SqlParameter("@CategoryId", SqlDbType.Int);
ParCategA.Value = tmpCategoryId;
MyDataAdapter2.SelectCommand.Parameters.Add(ParCategA);

SqlParameter ParMainCategA = new SqlParameter("@MainCateg", SqlDbType.Int);
ParMainCategA.Value = tmpMainCateg;
MyDataAdapter2.SelectCommand.Parameters.Add(ParMainCategA);

SqlParameter ParShipWeekA = new SqlParameter("@ShipWeek", SqlDbType.DateTime);
ParShipWeekA.Value = tmpShipWeek;
MyDataAdapter2.SelectCommand.Parameters.Add(ParShipWeekA);

SqlParameter ParAvailOnlyA = new SqlParameter("@AvailableOnly", SqlDbType.Int);
ParAvailOnlyA.Value = tmpAvailableOnly;
MyDataAdapter2.SelectCommand.Parameters.Add(ParAvailOnlyA);

SqlParameter ParProdFormA = new SqlParameter("@ProdForm", SqlDbType.Int);
ParProdFormA.Value = tmpProdForm;
MyDataAdapter2.SelectCommand.Parameters.Add(ParProdFormA);

MyDataAdapter2.SelectCommand.CommandTimeout = int.MaxValue;
MyDataAdapter2.Fill(DS, "ProdForms");

DS.Relations.Add("MyRelation", DS.Tables["Products"].Columns["StockSiPk"], DS.Tables["ProdForms"].Columns["StockSiPk"]);

Products.DataSource = DS.Tables["Products"].DefaultView;
Products.DataBind();

for (int i = 200; i > 0; i--)
{
//Nothing here just waiting toprevent timeouts -- not sure if this is really working
}
}
AnswerRe: Nested Datalist Selection sometimes fails when large data or clicking to fast -- Guessing Timeout ?? Ideas??? Going Crazy! Pin
Harvey Saayman1-Jul-08 22:39
Harvey Saayman1-Jul-08 22:39 
QuestionHow can we convert string to Brush ? Pin
Mohammad Dayyan1-Jul-08 10:42
Mohammad Dayyan1-Jul-08 10:42 
AnswerRe: How can we convert string to Brush ? Pin
User 66581-Jul-08 10:49
User 66581-Jul-08 10:49 
GeneralRe: How can we convert string to Brush ? Pin
Mohammad Dayyan1-Jul-08 15:11
Mohammad Dayyan1-Jul-08 15:11 
GeneralRe: How can we convert string to Brush ? Pin
Christian Graus1-Jul-08 15:55
protectorChristian Graus1-Jul-08 15:55 
GeneralRe: How can we convert string to Brush ? Pin
Bert delaVega1-Jul-08 18:23
Bert delaVega1-Jul-08 18:23 
AnswerRe: How can we convert string to Brush ? Pin
Bert delaVega1-Jul-08 18:43
Bert delaVega1-Jul-08 18:43 
QuestionHow to place Assemblies or DLL's in a subfolder Pin
earlgraham1-Jul-08 10:41
earlgraham1-Jul-08 10:41 
AnswerRe: How to place Assemblies or DLL's in a subfolder Pin
Pete O'Hanlon1-Jul-08 11:03
mvePete O'Hanlon1-Jul-08 11:03 
AnswerRe: How to place Assemblies or DLL's in a subfolder Pin
earlgraham8-Jul-08 11:35
earlgraham8-Jul-08 11:35 
Questionaccessing objects in form by index or somthing like index Pin
Sajjad Izadi1-Jul-08 9:19
Sajjad Izadi1-Jul-08 9:19 
AnswerRe: accessing objects in form by index or somthing like index Pin
Pete O'Hanlon1-Jul-08 9:44
mvePete O'Hanlon1-Jul-08 9:44 
GeneralRe: accessing objects in form by index or somthing like index Pin
Sajjad Izadi1-Jul-08 9:52
Sajjad Izadi1-Jul-08 9:52 
GeneralRe: accessing objects in form by index or somthing like index Pin
User 66581-Jul-08 10:31
User 66581-Jul-08 10:31 
GeneralRe: accessing objects in form by index or somthing like index Pin
Sajjad Izadi1-Jul-08 10:37
Sajjad Izadi1-Jul-08 10:37 
AnswerRe: accessing objects in form by index or somthing like index Pin
luisnike191-Jul-08 9:59
luisnike191-Jul-08 9:59 
GeneralRe: accessing objects in form by index or somthing like index Pin
Sajjad Izadi1-Jul-08 10:41
Sajjad Izadi1-Jul-08 10:41 

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.