Click here to Skip to main content
15,908,776 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: javascript function call from user control's command button Pin
Christian Graus10-Sep-08 8:07
protectorChristian Graus10-Sep-08 8:07 
GeneralRe: javascript function call from user control's command button Pin
Neeraj Arora10-Sep-08 8:15
Neeraj Arora10-Sep-08 8:15 
GeneralRe: javascript function call from user control's command button Pin
Christian Graus10-Sep-08 8:30
protectorChristian Graus10-Sep-08 8:30 
AnswerRe: javascript function call from user control's command button Pin
naveedmazhar10-Sep-08 18:24
naveedmazhar10-Sep-08 18:24 
QuestionChild Control Problem With Page_Load Pin
Brady Kelly10-Sep-08 7:10
Brady Kelly10-Sep-08 7:10 
QuestionHow can hide IE 7 vertical scrollbars? Pin
JUNEYT10-Sep-08 6:46
JUNEYT10-Sep-08 6:46 
AnswerRe: How can hide IE 7 vertical scrollbars? Pin
Christian Graus10-Sep-08 7:07
protectorChristian Graus10-Sep-08 7:07 
QuestionSend ArrayList to aspx page from Webservice Pin
huge_superman10-Sep-08 6:16
huge_superman10-Sep-08 6:16 
Hi, I got the following code in my webservice. The code gets VARCHAR values from within a sql database:

[WebMethod]
public ArrayList GetUserInfo(string email)
{
ArrayList userInfo = null;

try
{
conn = new SqlConnection("User Id=sa;Password=myne;Initial Catalog=Bank;Data Source=myComp");
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT mem_Name, mem_IdNum, mem_Email, mem_Address, mem_PhoneNumber, mem_Question, mem_Answer FROM Member WHERE mem_Email = '" + email + "'";
SqlDataReader reader = cmd.ExecuteReader();

reader.Read();
userInfo = new ArrayList();
userInfo.Add(reader[0].ToString());
userInfo.Add(reader[1].ToString());
userInfo.Add(reader[2].ToString());
userInfo.Add(reader[3].ToString());
userInfo.Add(reader[4].ToString());
userInfo.Add(reader[5].ToString());
userInfo.Add(reader[6].ToString());

conn.Close();
}
catch (SqlException sqlex)
{

}
finally
{
if (conn != null)
{
conn.Close();
}
}

return userInfo;
}//End GetUserInfo

I the call this method from an aspx web page, which looks like this:

void Page_Load(Object sender, EventArgs e)
{
if ((string)Session["email"] == null) //check if user logged in successfuly
{
Response.Redirect("login.aspx"); //if not got to login page
}
else
{
ArrayList myList = new ArrayList();
ServiceControl serCon = new ServiceControl(); //new instance of webservice class
string ed = (string)Session["email"]; //get the stored email from login
myList = serCon.GetUserInfo(ed); copy arrayList from webservice into new arraylist
}
}//End Page_Load

Everytime i'm redirected to the page, I get the following error on the following line of code:
myList = serCon.GetUserInfo(ed);

CS0029: Cannot implicitly convert type 'object[]' to 'System.Collections.ArrayList'

Do anyone know how I can fix this error please?
Iv'e tried adding .ToString(), iv'e tried casting to string, but with no luck.
AnswerRe: Send ArrayList to aspx page from Webservice Pin
Christian Graus10-Sep-08 6:23
protectorChristian Graus10-Sep-08 6:23 
GeneralRe: Send ArrayList to aspx page from Webservice Pin
SomeGuyThatIsMe10-Sep-08 7:47
SomeGuyThatIsMe10-Sep-08 7:47 
GeneralRe: Send ArrayList to aspx page from Webservice Pin
Christian Graus10-Sep-08 8:06
protectorChristian Graus10-Sep-08 8:06 
JokeRe: Send ArrayList to aspx page from Webservice Pin
SomeGuyThatIsMe10-Sep-08 8:13
SomeGuyThatIsMe10-Sep-08 8:13 
AnswerRe: Send ArrayList to aspx page from Webservice Pin
Guffa10-Sep-08 20:39
Guffa10-Sep-08 20:39 
GeneralRe: Send ArrayList to aspx page from Webservice Pin
huge_superman11-Sep-08 9:26
huge_superman11-Sep-08 9:26 
AnswerRe: Send ArrayList to aspx page from Webservice Pin
Anurag Sharma - Backoffice12-Sep-08 21:35
Anurag Sharma - Backoffice12-Sep-08 21:35 
Question[Message Deleted] Pin
Omar Gameel Salem10-Sep-08 5:46
professionalOmar Gameel Salem10-Sep-08 5:46 
AnswerRe: Sql update problem in content page Pin
Christian Graus10-Sep-08 6:15
protectorChristian Graus10-Sep-08 6:15 
GeneralRe: Sql update problem in content page Pin
Omar Gameel Salem10-Sep-08 8:07
professionalOmar Gameel Salem10-Sep-08 8:07 
QuestionShow Computer name and IP of the computer viewing the web page Pin
SAadmin10-Sep-08 4:50
SAadmin10-Sep-08 4:50 
AnswerRe: Show Computer name and IP of the computer viewing the web page Pin
Guffa10-Sep-08 20:46
Guffa10-Sep-08 20:46 
GeneralRe: Show Computer name and IP of the computer viewing the web page Pin
SAadmin10-Sep-08 21:00
SAadmin10-Sep-08 21:00 
GeneralRe: Show Computer name and IP of the computer viewing the web page Pin
Guffa10-Sep-08 21:14
Guffa10-Sep-08 21:14 
GeneralRe: Show Computer name and IP of the computer viewing the web page Pin
SAadmin11-Sep-08 0:49
SAadmin11-Sep-08 0:49 
GeneralStrange Namespace Issue - Solved [modified] Pin
Brady Kelly10-Sep-08 4:39
Brady Kelly10-Sep-08 4:39 
QuestionTitle problem Pin
krishnaveer10-Sep-08 2:36
krishnaveer10-Sep-08 2:36 

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.