Click here to Skip to main content
16,020,253 members
Home / Discussions / C#
   

C#

 
QuestionBinding Combobox to related tables ! Pin
User 209307313-Jul-06 6:48
User 209307313-Jul-06 6:48 
QuestionHow to modified text file in C Pin
arun.m13-Jul-06 6:02
arun.m13-Jul-06 6:02 
AnswerRe: How to modified text file in C Pin
Christian Graus13-Jul-06 6:03
protectorChristian Graus13-Jul-06 6:03 
QuestionLosing value of object Pin
leckey13-Jul-06 5:54
leckey13-Jul-06 5:54 
AnswerRe: Losing value of object Pin
Christian Graus13-Jul-06 6:02
protectorChristian Graus13-Jul-06 6:02 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:05
leckey13-Jul-06 6:05 
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 9:04
Guffa13-Jul-06 9:04 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 9:57
leckey13-Jul-06 9:57 
Thanks for the explanation, Guffa. That really did help me understand it better.
To get around it in the meantime I did a session:
public void btnAdd_Click(object sender, System.EventArgs e)<br />
		{<br />
			strPartNumberInputReference = txtSearchPart.Text;<br />
			strPartTypeID = ddPartType.SelectedValue;<br />
			strDwgNumber = txtDwgNumber.Text;<br />
			strDwgRevision = txtDwgRevision.Text;<br />
			strDwgLocation = txtDwgLocation.Text;	<br />
			SqlParameter param1 = new SqlParameter("@PartNumber", strPartNumberInputReference);	<br />
			SqlParameter param2 = new SqlParameter("@PartTypeValue", strPartTypeID);<br />
			SqlParameter param3 = new SqlParameter("@ID", SqlDbType.Int);<br />
			param3.Direction = ParameterDirection.Output;<br />
			 try<br />
			{<br />
				IDOutput = SqlHelper.ExecuteNonQuery (this.connectionString, CommandType.StoredProcedure, "dbo.UpdatePart_Step_1", param1, param2, param3);<br />
				IDOutput2 = param3.Value;<br />
				SqlParameter param4 = new SqlParameter("@DwgRevision", strDwgRevision);<br />
				SqlParameter param5 = new SqlParameter("@DwgNumber", strDwgNumber);<br />
				SqlParameter param6 = new SqlParameter("@DwgLocation", strDwgLocation);<br />
				SqlParameter param7 = new SqlParameter("@ID2", IDOutput2);<br />
				IDOutput = SqlHelper.ExecuteNonQuery (this.connectionString, CommandType.StoredProcedure, "dbo.UpdatePart_Step_1_part2", param4, param5, param6, param7);<br />
				Response.Write ("Successful update.");<br />
				txtSearchPart.Text = "";<br />
				txtDwgNumber.Text = "";<br />
				txtDwgLocation.Text = "";<br />
				txtDwgRevision.Text = "";<br />
				ddPartType.SelectedIndex = 1;<br />
				Response.Write (IDOutput2);<br />
				Session["number"] = IDOutput2;				Session["strPartNumberInputReference"] = strPartNumberInputReference;<br />
			<br />
			}<br />
<br />
			catch<br />
			{<br />
				Response.Write ("Insert failed.");<br />
			}<br />
		}


Then called the session on pageload
private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			IDOutput3 = Session["number"];<br />
			if(Page.IsPostBack)<br />
			{<br />
				BindData();	<br />
.<br />
.<br />
.


Is there a different way (a better way) to do this that would be considered a best practice?
AnswerRe: Losing value of object Pin
Guffa13-Jul-06 11:55
Guffa13-Jul-06 11:55 
AnswerRe: Losing value of object Pin
Josh Smith13-Jul-06 6:06
Josh Smith13-Jul-06 6:06 
GeneralRe: Losing value of object Pin
leckey13-Jul-06 6:11
leckey13-Jul-06 6:11 
GeneralRe: Losing value of object Pin
Josh Smith13-Jul-06 7:44
Josh Smith13-Jul-06 7:44 
QuestionHow to implement Trees ... Pin
JamesT113-Jul-06 5:38
JamesT113-Jul-06 5:38 
AnswerRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:45
protectorChristian Graus13-Jul-06 5:45 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:50
Josh Smith13-Jul-06 5:50 
GeneralRe: How to implement Trees ... Pin
Christian Graus13-Jul-06 5:53
protectorChristian Graus13-Jul-06 5:53 
GeneralRe: How to implement Trees ... Pin
Josh Smith13-Jul-06 5:59
Josh Smith13-Jul-06 5:59 
GeneralRe: How to implement Trees ... Pin
led mike13-Jul-06 7:28
led mike13-Jul-06 7:28 
AnswerRe: How to implement Trees ... Pin
Jun Du13-Jul-06 5:51
Jun Du13-Jul-06 5:51 
AnswerRe: How to implement Trees ... [modified] Pin
User 665813-Jul-06 5:53
User 665813-Jul-06 5:53 
AnswerRe: How to implement Trees ... Pin
BoneSoft13-Jul-06 6:13
BoneSoft13-Jul-06 6:13 
AnswerCS 101 Pin
Ennis Ray Lynch, Jr.13-Jul-06 6:22
Ennis Ray Lynch, Jr.13-Jul-06 6:22 
AnswerRe: How to implement Trees ... Pin
Eric Dahlvang13-Jul-06 7:54
Eric Dahlvang13-Jul-06 7:54 
QuestionTrying to print an html page without to load it in asp.net Pin
sai_akkina13-Jul-06 5:12
sai_akkina13-Jul-06 5:12 
AnswerRe: Trying to print an html page without to load it in asp.net Pin
Not Active13-Jul-06 5:24
mentorNot Active13-Jul-06 5:24 

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.