Click here to Skip to main content
16,006,355 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I format a richTextBox? Pin
mikanu21-Jun-06 6:27
mikanu21-Jun-06 6:27 
QuestionC# Application: How to associate an icon Pin
kirkangel20-Jun-06 9:33
kirkangel20-Jun-06 9:33 
AnswerRe: C# Application: How to associate an icon Pin
Judah Gabriel Himango20-Jun-06 9:36
sponsorJudah Gabriel Himango20-Jun-06 9:36 
JokeRe: C# Application: How to associate an icon Pin
kirkangel27-Jun-06 10:23
kirkangel27-Jun-06 10:23 
QuestionProblem using EntLib DAAB for .NET 2.0 Pin
supD20-Jun-06 9:27
supD20-Jun-06 9:27 
AnswerRe: Problem using EntLib DAAB for .NET 2.0 Pin
Judah Gabriel Himango20-Jun-06 9:35
sponsorJudah Gabriel Himango20-Jun-06 9:35 
AnswerRe: Problem using EntLib DAAB for .NET 2.0 Pin
Blue(Shanghai)20-Jun-06 16:31
Blue(Shanghai)20-Jun-06 16:31 
QuestionDatagrid showing bogus data when page loads Pin
leckey20-Jun-06 8:36
leckey20-Jun-06 8:36 
Note I also posted this on the SQL page as I think it might be a problem with that but not sure.

I have the user enter a part number, click a button, which loads the datagrid. I've been playing around with the SQL statement as I was getting duplicate rows. Now, when the grid loads there is completely bogus data from the database. Not sure what it's tied to or if it's just the first record. Does anyone know what may be causing this issue? I have included the SQL info for reference:
private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			if(!Page.IsPostBack)<br />
			{<br />
				BindData();<br />
			}<br />
		}<br />
		private void BindData()<br />
		{<br />
			strPartNumberInputReference = txtPartNumberInput.Text;<br />
						<br />
<br />
			string SQLString = "SELECT p.PartNumber, pt.description, dd.DrawingNumber, dd.DrawingRevision, dd.DwgPath FROM parts p INNER JOIN PartTypes pt on pt.ID =p.PartTypeID LEFT JOIN DraftingData dd on dd.PartID = p.ID WHERE p.PartNumber = @PartID;SELECT w.weight, wt.Description AS wtDescription, p.PartNumber from weights w INNER JOIN weighttypes wt on wt.ID = w.weighttypeid INNER JOIN Parts p on w.PartID = p.ID;SELECT c.cost, p.PartNumber, ct.Description AS ctDescription from Costs c INNER JOIN Parts p ON c.PartID = p.Id INNER JOIN CostTypes ct on ct.Id = c.CostTypeID; SELECT s.SubPartID, s.Quantity, s.Sequence, p.PartNumber FROM SubParts s INNER JOIN Parts p ON s.PartID = p.Id "; <br />
						<br />
			SqlCommand cmd = new SqlCommand();<br />
			cmd.Connection = new SqlConnection(strConnectSQL);<br />
			cmd.CommandText = SQLString;<br />
			cmd.Parameters.Add ("@PartID", strPartNumberInputReference);<br />
			SqlDataAdapter adapter = new SqlDataAdapter(cmd);<br />
			adapter.Fill(ds);<br />
//			<br />
			ds.Tables[1].TableName = "Weights";<br />
			ds.Tables[2].TableName = "Costs";<br />
			ds.Tables[3].TableName = "Subparts";<br />
		<br />
			dgParts.DataSource = ds;<br />
			dgParts.DataBind();<br />
			txtPartNumberInput.Text = "";<br />
		}


So either I have duplicates or bogus stuff. Does anyone see the problem? I really have tried to work this one out but get one problem or the other!Confused | :confused:
AnswerRe: Datagrid showing bogus data when page loads Pin
freshonlineMax20-Jun-06 19:20
freshonlineMax20-Jun-06 19:20 
Questionquestion about MS spell check Pin
likefood20-Jun-06 8:34
likefood20-Jun-06 8:34 
AnswerRe: question about MS spell check Pin
likefood20-Jun-06 8:38
likefood20-Jun-06 8:38 
QuestionGDI : how does paint event work? Pin
User 309585920-Jun-06 8:13
User 309585920-Jun-06 8:13 
AnswerRe: GDI : how does paint event work? Pin
Johnny Hooyberghs20-Jun-06 8:38
Johnny Hooyberghs20-Jun-06 8:38 
GeneralRe: GDI : how does paint event work? Pin
User 309585920-Jun-06 8:44
User 309585920-Jun-06 8:44 
Questioncatching exceptions and posting them in a dialog Pin
Johnny Hooyberghs20-Jun-06 7:41
Johnny Hooyberghs20-Jun-06 7:41 
AnswerRe: catching exceptions and posting them in a dialog Pin
Dan Neely20-Jun-06 8:09
Dan Neely20-Jun-06 8:09 
GeneralRe: catching exceptions and posting them in a dialog Pin
Johnny Hooyberghs20-Jun-06 8:25
Johnny Hooyberghs20-Jun-06 8:25 
GeneralRe: catching exceptions and posting them in a dialog Pin
Dan Neely20-Jun-06 8:51
Dan Neely20-Jun-06 8:51 
QuestionStatic constructor Pin
Ista20-Jun-06 6:37
Ista20-Jun-06 6:37 
AnswerRe: Static constructor Pin
Le centriste20-Jun-06 8:54
Le centriste20-Jun-06 8:54 
GeneralRe: Static constructor Pin
Ista20-Jun-06 8:55
Ista20-Jun-06 8:55 
GeneralRe: Static constructor Pin
Josh Smith20-Jun-06 9:42
Josh Smith20-Jun-06 9:42 
JokeRe: Static constructor Pin
Le centriste21-Jun-06 8:57
Le centriste21-Jun-06 8:57 
GeneralRe: Static constructor Pin
Josh Smith24-Jun-06 15:37
Josh Smith24-Jun-06 15:37 
QuestionArgh, no matter how long I stare at this, I don't get it (XML Serialization related) [modified] Pin
ThisIsMyUserName220-Jun-06 6:37
ThisIsMyUserName220-Jun-06 6:37 

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.