Click here to Skip to main content
15,911,890 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionClass inherting User Control and implementing ITemplate Pin
tsramkumar6-Sep-07 20:40
tsramkumar6-Sep-07 20:40 
QuestionCheckbox and FileUpload control query Pin
Shaurya_Rastogi6-Sep-07 20:39
Shaurya_Rastogi6-Sep-07 20:39 
QuestionHow to handle Multiple Asynchronous Requests at one time? Pin
IshfaqHussain6-Sep-07 20:04
IshfaqHussain6-Sep-07 20:04 
QuestionCascadingDropDown and AutoCompleteExtender Pin
varshavmane6-Sep-07 19:05
varshavmane6-Sep-07 19:05 
AnswerRe: CascadingDropDown and AutoCompleteExtender Pin
Imran Khan Pathan6-Sep-07 19:44
Imran Khan Pathan6-Sep-07 19:44 
GeneralRe: CascadingDropDown and AutoCompleteExtender Pin
varshavmane6-Sep-07 19:57
varshavmane6-Sep-07 19:57 
GeneralRe: CascadingDropDown and AutoCompleteExtender Pin
Imran Khan Pathan6-Sep-07 20:25
Imran Khan Pathan6-Sep-07 20:25 
GeneralRe: CascadingDropDown and AutoCompleteExtender Pin
varshavmane6-Sep-07 20:39
varshavmane6-Sep-07 20:39 
As I want to show it in list formate so I use this "CompletionListElementID"

and the code for GetCompletionList1 is below:

public string[] GetCompletionList1(string prefixText, int count)
{
conn.ConnectionString = cs.connectionDBcentral();// new SqlConnection("server='192.168.11.7'; user id='cd'; password='cd'; database='DbCentralData'");

DataTable dtReturn = new DataTable();

conn.Open();

SqlCommand cmd = new SqlCommand("SELECT Top 10 Ticker,coname FROM tbCompMaster where (Ticker like @searchterm or coname like @searchterm )ORDER BY coname ", conn);

SqlParameter param = new SqlParameter();
param.ParameterName = "@searchterm";
prefixText.Trim().Replace("'", "''");

prefixText += "%";
param.Value = prefixText;
cmd.Parameters.Add(param);
SqlDataAdapter adpt = new SqlDataAdapter(cmd);
adpt.Fill(dtReturn);

//Random random = new Random();
List<string> items = new List<string>(count);
for (int i = 0; i < dtReturn.Rows.Count; i++)
{
string c1 = (string)dtReturn.Rows[i]["Ticker"];
string c2 = "-";
string c3 = (string)dtReturn.Rows[i]["coname"];

items.Add(c1 + c2 + c3);
}
conn.Close();
return items.ToArray();
}

Actually I have return another fuunction which fills Company Combo and it is:

public CascadingDropDownNameValue[] GetTicker(string knownCategoryValues, string category)
{
string[] SectorValues = knownCategoryValues.Split(';');
string[] cou = SectorValues[0].Split(':');
Session["Country"] = cou[1];
string[] sec = SectorValues[1].Split(':');
string[] subindustry = SectorValues[2].Split(':');
Session["SubindustryID"] = subindustry[1];
string key = "Category" + subindustry[1];

DataSet ds = (DataSet)HttpContext.Current.Cache[key];
ds = new DataSet();
SqlConnection myConnection = new SqlConnection();
if (ds != null)
{
switch (Convert.ToInt16(Session["Country"]))
{
case 1:
conn.ConnectionString = cs.connectionUS();
break;
case 2:
conn.ConnectionString = cs.connectionUK();
break;
case 3:
conn.ConnectionString = cs.connectionJP();
break;
default:
conn.ConnectionString = cs.connectionUS();
break;
}
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
string strcomp = sec[1] + "______";
cmd.CommandText = " SELECT Top 10 Ticker,coname FROM tbCompMaster where GICSCode =" + Session["SectorID"] + " or GICSCode=" + Session["SubindustryID"] + " ORDER BY coname";

SqlDataAdapter adpt = new SqlDataAdapter(cmd);
adpt.Fill(ds);
DateTime t =DateTime.Now.AddHours(24);

HttpContext.Current.Cache.Insert(key, ds);
conn.Close();
}
else
{
ds = (DataSet)HttpContext.Current.Cache[key];
}

List<ajaxcontroltoolkit.cascadingdropdownnamevalue> values = new List<ajaxcontroltoolkit.cascadingdropdownnamevalue>();
foreach (DataRow row in ds.Tables[0].Rows)
{
values.Add(new AjaxControlToolkit.CascadingDropDownNameValue(row["coname"].ToString(), row["Ticker"].ToString()));

}
return values.ToArray();
}
But I am not getting how to combine these two function so that it works fine.
Please help me...
Thanks again...
QuestionError including master page in general forms Pin
Dhyanga6-Sep-07 18:50
Dhyanga6-Sep-07 18:50 
QuestionLogin Controls from toolbox Pin
duo!@#6-Sep-07 18:28
duo!@#6-Sep-07 18:28 
AnswerRe: Login Controls from toolbox Pin
Sandeep Akhare6-Sep-07 19:43
Sandeep Akhare6-Sep-07 19:43 
GeneralRe: Login Controls from toolbox Pin
duo!@#6-Sep-07 20:29
duo!@#6-Sep-07 20:29 
AnswerRe: Login Controls from toolbox Pin
satyaki mishra6-Sep-07 23:18
satyaki mishra6-Sep-07 23:18 
QuestionAccess Denied Pin
Rmesh6-Sep-07 17:42
Rmesh6-Sep-07 17:42 
AnswerRe: Access Denied Pin
Imran Khan Pathan6-Sep-07 18:06
Imran Khan Pathan6-Sep-07 18:06 
GeneralRe: Access Denied Pin
Rmesh6-Sep-07 23:17
Rmesh6-Sep-07 23:17 
AnswerRe: Access Denied Pin
Sandeep Akhare6-Sep-07 19:47
Sandeep Akhare6-Sep-07 19:47 
GeneralRe: Access Denied Pin
Rmesh6-Sep-07 23:31
Rmesh6-Sep-07 23:31 
AnswerRe: Access Denied Pin
Shujaat Ullah Khan6-Sep-07 20:43
Shujaat Ullah Khan6-Sep-07 20:43 
GeneralRe: Access Denied Pin
Rmesh6-Sep-07 23:27
Rmesh6-Sep-07 23:27 
GeneralRe: Access Denied Pin
Shujaat Ullah Khan7-Sep-07 0:10
Shujaat Ullah Khan7-Sep-07 0:10 
QuestionHyperlink in Grid view Pin
seemamltn6-Sep-07 12:42
seemamltn6-Sep-07 12:42 
AnswerRe: Hyperlink in Grid view Pin
Imran Khan Pathan6-Sep-07 18:12
Imran Khan Pathan6-Sep-07 18:12 
AnswerRe: Hyperlink in Grid view Pin
codelinks6-Sep-07 19:38
codelinks6-Sep-07 19:38 
Questionpower point open or save Pin
greekius6-Sep-07 7:13
greekius6-Sep-07 7:13 

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.