Click here to Skip to main content
15,917,862 members
Home / Discussions / Web Development
   

Web Development

 
Questioncopy file to network folder Pin
Dpriya27-Jul-07 16:12
Dpriya27-Jul-07 16:12 
AnswerRe: copy file to network folder Pin
Vasudevan Deepak Kumar28-Jul-07 21:27
Vasudevan Deepak Kumar28-Jul-07 21:27 
AnswerRe: copy file to network folder Pin
Paul Conrad29-Jul-07 5:48
professionalPaul Conrad29-Jul-07 5:48 
Question"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" Pin
bobby100m27-Jul-07 9:52
bobby100m27-Jul-07 9:52 
AnswerRe: "An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)" Pin
Vasudevan Deepak Kumar28-Jul-07 21:30
Vasudevan Deepak Kumar28-Jul-07 21:30 
QuestionSilverlight in VS2005 Pin
Heavy Storm27-Jul-07 7:51
Heavy Storm27-Jul-07 7:51 
Questioncreate a dynamic drop down menu Pin
Babru27-Jul-07 3:27
Babru27-Jul-07 3:27 
AnswerRe: create a dynamic drop down menu Pin
SomeGuyThatIsMe27-Jul-07 4:21
SomeGuyThatIsMe27-Jul-07 4:21 
there should be a bunch of examples online that will give you most if not all of the code you need. assuming that the value you want as the default is in the database, you just need to do dropDownList.SelectedValue = value; or you could use the SelectedIndex if you know exactly where the value will be in the data set and its location wont move. to bind the dropdownlist you just need to open an SqlConnection to the database set up a SqlCommand with your query and connection and use its ExecuteReader method to load a SqlDataReader which will then bind to a dropdown list like

sring sql = "";
SqlConnection myConnection = new SqlConnection(connectionString);
SqlCommad myCommand = null;
SqlDataReader myReader = null;

try{
myConnection.Open();
sql = "put your query here";
myCommand = new SqlCommand(sql, myConnection);
myReader = myCommand.ExectueReader();

dropDownList.DataSource = myReader;
dropDownList.DataTextField = "the field you want displayed";
dropDownList.DataValueField = "the value you want stored, like an id number"
dropDownList.DataBind();
//if you want to insert a value tat isnt in the database youjust need
dropDownList.Items.Insert(0,value);//i havnt used that ina while
//but is the locaiton in the array you want the item palces and value is the
//text to display
}catch(Exception e)
{
}
finally{
if(myCommand != null)myCommand.Dispose();
if(myReader !=null) myReader.Close();
myConnection.Close();
}

hope this helped
Questionframe problem Pin
SomeGuyThatIsMe27-Jul-07 2:59
SomeGuyThatIsMe27-Jul-07 2:59 
GeneralRe: frame problem Pin
Ryanb5827-Jul-07 3:31
Ryanb5827-Jul-07 3:31 
AnswerRe: frame problem Pin
Guffa27-Jul-07 3:38
Guffa27-Jul-07 3:38 
GeneralRe: frame problem Pin
SomeGuyThatIsMe27-Jul-07 4:13
SomeGuyThatIsMe27-Jul-07 4:13 
AnswerRe: frame problem Pin
Guffa27-Jul-07 8:23
Guffa27-Jul-07 8:23 
GeneralRe: frame problem Pin
SomeGuyThatIsMe27-Jul-07 8:26
SomeGuyThatIsMe27-Jul-07 8:26 
Questionimage in IE7 Pin
Milind Panchal26-Jul-07 21:11
Milind Panchal26-Jul-07 21:11 
AnswerRe: image in IE7 Pin
Guffa27-Jul-07 2:42
Guffa27-Jul-07 2:42 
QuestionExport to Excel or XML Pin
Illegal Operation26-Jul-07 20:36
Illegal Operation26-Jul-07 20:36 
AnswerRe: Export to Excel or XML Pin
Vasudevan Deepak Kumar28-Jul-07 22:08
Vasudevan Deepak Kumar28-Jul-07 22:08 
Questionhow to perform basic authorization Pin
Araj0126-Jul-07 8:39
Araj0126-Jul-07 8:39 
AnswerRe: how to perform basic authorization Pin
JimmyRopes26-Jul-07 11:50
professionalJimmyRopes26-Jul-07 11:50 
GeneralRe: how to perform basic authorization Pin
Araj0126-Jul-07 14:25
Araj0126-Jul-07 14:25 
GeneralRe: how to perform basic authorization Pin
JimmyRopes26-Jul-07 14:43
professionalJimmyRopes26-Jul-07 14:43 
GeneralRe: how to perform basic authorization Pin
Johnny ²26-Jul-07 18:25
Johnny ²26-Jul-07 18:25 
GeneralRe: how to perform basic authorization Pin
JimmyRopes26-Jul-07 20:21
professionalJimmyRopes26-Jul-07 20:21 
GeneralRe: how to perform basic authorization Pin
Araj0127-Jul-07 7:31
Araj0127-Jul-07 7:31 

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.