Click here to Skip to main content
15,902,894 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionsql server n ASP.NET Pin
hariram2815-Apr-07 6:44
hariram2815-Apr-07 6:44 
AnswerRe: sql server n ASP.NET Pin
Jaiprakash M Bankolli15-Apr-07 7:50
Jaiprakash M Bankolli15-Apr-07 7:50 
Questionpage type in ASP.NET Pin
hariram2815-Apr-07 6:17
hariram2815-Apr-07 6:17 
AnswerRe: page type in ASP.NET Pin
Jaiprakash M Bankolli15-Apr-07 7:51
Jaiprakash M Bankolli15-Apr-07 7:51 
AnswerRe: page type in ASP.NET Pin
RichardGrimmer16-Apr-07 0:52
RichardGrimmer16-Apr-07 0:52 
GeneralRe: page type in ASP.NET Pin
hariram2818-Apr-07 7:20
hariram2818-Apr-07 7:20 
GeneralRe: page type in ASP.NET Pin
RichardGrimmer18-Apr-07 21:45
RichardGrimmer18-Apr-07 21:45 
QuestionPopulating and Implementing 4 DropDown Listboxes from one table on the Web Form Pin
koonda00715-Apr-07 3:45
koonda00715-Apr-07 3:45 
Hi all,

I have a Project due after one week. It is a web service project. I have a Web Form which communicates to the web service and this web service communicates to the database. I have all my SQL statements in the Data Acess Layer to create more secure web service application. The Web service class is also in the Data Access Layer. I need to populates the 4 Dropdown list boxes on the web form from one table. I have Customer table which contains information About CustomerName, CustomerType, Address, City. These 4 colum values should populate the 4 Dropdown lists. And then I need to implement those 4 dropdowns like this. When the user selects a Customername it should display relevant customer information in the GridView. Or when the user selects values from all 4 listboxes it should display all information on GridView as well.

For all the above I have just populated one listbox but I don't know how to populate the other 3 dropdown lists and implement them on the web form.

I have created one method in the Data Access Layer class and one method in the Web Service class and then I instaitiated the web service object in the web form by adding a web reference. It works fine for just populating one dropdown list box but for the whole 4 dropdown list I am unable to populated and Implement them.

Below are the methods and the code for one dropdownlist.



(1)Web Form code:


WebService.Service ws = new WebService.Service();

protected void Page_Load(object sender, EventArgs e)
{


object[] alist;
alist = ws.GetBusinessType(string.Empty);
DropDownList1.DataSource = alist;
DropDownList1.DataBind();



(2) Web Service Method:


[WebMethod]
public ArrayList GetBusinessType(string btype)
{
DAccess ODA = new DAccess(); //Data Access object
ArrayList list = new ArrayList();

list = ODA.GetBusinessType(btype); //Data Access method

return list;

}


(3) Data Access method:

public ArrayList GetBusinessType(string btype)
{
SqlConnection connection = GetConnection;
try
{
ArrayList arrbt = new ArrayList();


StringBuilder sql = new StringBuilder()
.AppendLine("SELECT")
.AppendLine("\tTYPENAME")
.AppendLine("\tFROM")
.AppendLine("\tBUSINESS_TYPE");

SqlParameter paramTYPENAME = new SqlParameter("TYPENAME", SqlDbType.NVarChar);
paramTYPENAME.Value = btype;

connection.Open();

SqlDataReader reader = ExecuteQuery(connection, sql.ToString(), paramTYPENAME);

while (reader.Read())
{
string result = reader["TYPENAME"].ToString();
arrbt.Add(result);

}

return arrbt;
}
catch (Exception ex)
{
return null;
//do some log here Call a class that logs the errors
}
finally
{
connection.Close();
}


All the above code works fine for just populating the one dropdown list but not implementing. I just want the implementation something like....When the user select one dropdown or all of them then it should display the result in the gridview. I have not shown the aspx code here but the main thing is the code above. Can any one help me to implement this

I really appreciate your help. Looking forward to your reply.

Thanks

Koonda
AnswerRe: Populating and Implementing 4 DropDown Listboxes from one table on the Web Form Pin
Chetan Ranpariya19-Apr-07 23:43
Chetan Ranpariya19-Apr-07 23:43 
GeneralRe: Populating and Implementing 4 DropDown Listboxes from one table on the Web Form Pin
koonda00721-Apr-07 0:25
koonda00721-Apr-07 0:25 
QuestionDisabled textbox's text disappear after refresh Pin
customise14-Apr-07 22:43
customise14-Apr-07 22:43 
AnswerRe: Disabled textbox's text disappear after refresh Pin
Guffa15-Apr-07 0:10
Guffa15-Apr-07 0:10 
AnswerRe: Disabled textbox's text disappear after refresh Pin
TRK@UK15-Apr-07 4:09
TRK@UK15-Apr-07 4:09 
QuestionAjax Enabled TextBox Pin
monirkuet2414-Apr-07 18:40
monirkuet2414-Apr-07 18:40 
AnswerRe: Ajax Enabled TextBox Pin
Naveed Kamboh15-Apr-07 3:30
Naveed Kamboh15-Apr-07 3:30 
GeneralResize, Convert and Save Images... Pin
code-frog14-Apr-07 13:01
professionalcode-frog14-Apr-07 13:01 
GeneralRe: Resize, Convert and Save Images... Pin
Christian Graus15-Apr-07 12:18
protectorChristian Graus15-Apr-07 12:18 
GeneralRe: Resize, Convert and Save Images... Pin
code-frog15-Apr-07 14:16
professionalcode-frog15-Apr-07 14:16 
GeneralRe: Resize, Convert and Save Images... Pin
Christian Graus15-Apr-07 14:47
protectorChristian Graus15-Apr-07 14:47 
GeneralRe: Resize, Convert and Save Images... Pin
code-frog15-Apr-07 14:54
professionalcode-frog15-Apr-07 14:54 
GeneralRe: Resize, Convert and Save Images... Pin
Christian Graus15-Apr-07 15:03
protectorChristian Graus15-Apr-07 15:03 
QuestionDownload Access DB Pin
Ibuprofen14-Apr-07 11:26
Ibuprofen14-Apr-07 11:26 
AnswerRe: Download Access DB Pin
George L. Jackson14-Apr-07 15:52
George L. Jackson14-Apr-07 15:52 
GeneralRe: Download Access DB Pin
Ibuprofen15-Apr-07 3:00
Ibuprofen15-Apr-07 3:00 
GeneralRe: Download Access DB Pin
George L. Jackson15-Apr-07 3:14
George L. Jackson15-Apr-07 3:14 

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.