Click here to Skip to main content
16,012,468 members
Home / Discussions / C#
   

C#

 
QuestionHow can manipulate the subcontrols of a usercontrol Pin
Fco. Javier Marin26-Jun-06 11:30
Fco. Javier Marin26-Jun-06 11:30 
QuestionHelp with data source - jump to record. Pin
PyroManiak26-Jun-06 11:27
PyroManiak26-Jun-06 11:27 
Questionget point from onclick event Pin
reshsilk26-Jun-06 11:01
reshsilk26-Jun-06 11:01 
AnswerRe: get point from onclick event Pin
Josh Smith26-Jun-06 11:09
Josh Smith26-Jun-06 11:09 
GeneralRe: get point from onclick event Pin
reshsilk26-Jun-06 11:23
reshsilk26-Jun-06 11:23 
AnswerRe: get point from onclick event Pin
jjansen27-Jun-06 3:13
jjansen27-Jun-06 3:13 
GeneralRe: get point from onclick event Pin
Josh Smith28-Jun-06 1:51
Josh Smith28-Jun-06 1:51 
QuestionMicrosoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 9:20
leckey26-Jun-06 9:20 
I am using the Microsoft SQLHelper.cs class for my data connections. The user enters a part number, clicks a command button and the grid should load with that data. When I pass the parameter I cannot get the grid to populate. I have been working on this since Friday.

Here is my DataBind:
private void BindData()<br />
		{<br />
			strPartNumberInputReference = txtSearchPart.Text;<br />
			ds = new DataSet();<br />
			SqlParameter param = new SqlParameter("@PartID", strPartNumberInputReference);		<br />
			ds=SqlHelper.ExecuteDataset(this.connectionString, CommandTYpe.StoredProcedure,"dbo.GetPartInfoTest", param);<br />
			Session["ds"]=ds;<br />
			dt = ds.Tables[0];<br />
			Session["dt"]=dt;<br />
			dgParts.DataSource=dt;<br />
			dgParts.DataBind();<br />
			txtSearchPart.Text = "";<br />
			<br />
		}


I played around with the bolded line, and if I don't pass a parameter, all the stuff populates as expected.

In my stored procedure I have the following:
CREATE PROCEDURE [dbo].[GetPartInfoTest]<br />
<br />
@PartID  varchar<br />
 AS<br />
SELECT c.cost, ct.Description AS ctDescription, pt.description, pt.ID as PartTypeID, dd.DrawingNumber, dd.DrawingRevision, dd.DwgPath<br />
FROM costs c INNER JOIN Parts p ON c.PartID = p.Id <br />
INNER JOIN PartTypes pt on pt.ID = p.PartTypeID <br />
LEFT JOIN DraftingData dd on dd.PartID = p.ID LEFT JOIN CostTypes ct on ct.Id = c.CostTypeId<br />
<br />
where p.PartNumber = @PartID<br />
<br />
GO

Again, played around with this and changed @PartID to an actual part number and it populated fine.

I tried the debugger and it compliles fine. It says it takes the parameter and runs through the AttachParameters method (for those of you familiar with SQLHelper). But somehow it must be getting lost and the grid does not populate.

Page Load code:
private void Page_Load(object sender, System.EventArgs e)<br />
		{<br />
			<br />
			if(Page.IsPostBack)<br />
			{<br />
				BindData();	<br />
		<br />
<br />
			}<br />
			<br />
		}
Command button click code:
private void btnSearchPart_Click(object sender, System.EventArgs e)<br />
		{<br />
			BindData();<br />
		}


Can someone please walk me through this to get this stupid thing to populate? At one point I got it to populate with three blank lines. Now I'm not getting anything.WTF | :WTF:
AnswerRe: Microsoft SQLHelper.cs class parameter issue Pin
led mike26-Jun-06 9:53
led mike26-Jun-06 9:53 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 9:56
leckey26-Jun-06 9:56 
AnswerRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 10:31
Josh Smith26-Jun-06 10:31 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 10:36
leckey26-Jun-06 10:36 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 10:42
Josh Smith26-Jun-06 10:42 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 10:57
leckey26-Jun-06 10:57 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 11:06
Josh Smith26-Jun-06 11:06 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 11:11
leckey26-Jun-06 11:11 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 11:15
Josh Smith26-Jun-06 11:15 
AnswerRe: Microsoft SQLHelper.cs class parameter issue Pin
Michael P Butler26-Jun-06 10:45
Michael P Butler26-Jun-06 10:45 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 10:48
Josh Smith26-Jun-06 10:48 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 10:50
leckey26-Jun-06 10:50 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Josh Smith26-Jun-06 10:57
Josh Smith26-Jun-06 10:57 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 11:01
leckey26-Jun-06 11:01 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Michael P Butler26-Jun-06 11:22
Michael P Butler26-Jun-06 11:22 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
leckey26-Jun-06 11:37
leckey26-Jun-06 11:37 
GeneralRe: Microsoft SQLHelper.cs class parameter issue Pin
Michael P Butler26-Jun-06 11:51
Michael P Butler26-Jun-06 11:51 

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.