Click here to Skip to main content
15,899,313 members
Home / Discussions / C#
   

C#

 
AnswerRe: Stupid String Format Question - Answer Pin
gantww22-Jun-06 8:28
gantww22-Jun-06 8:28 
AnswerRe: Stupid String Format Question Pin
Dustin Metzgar22-Jun-06 8:28
Dustin Metzgar22-Jun-06 8:28 
QuestionSingle process instance object implemetation Pin
h4rdw4re122-Jun-06 8:11
h4rdw4re122-Jun-06 8:11 
AnswerRe: Single process instance object implemetation Pin
Dustin Metzgar22-Jun-06 8:22
Dustin Metzgar22-Jun-06 8:22 
QuestionIs the text box value a number Pin
sas949122-Jun-06 7:26
sas949122-Jun-06 7:26 
AnswerRe: Is the text box value a number Pin
Stefan Troschuetz22-Jun-06 7:39
Stefan Troschuetz22-Jun-06 7:39 
AnswerRe: Is the text box value a number Pin
User 665822-Jun-06 7:47
User 665822-Jun-06 7:47 
QuestionBlank datagrid--parameter issue? Pin
leckey22-Jun-06 6:53
leckey22-Jun-06 6:53 
Hello again all. I found an example of a fully editable datagrid that was attached to the Northwind database. I have been tinkering with it to use with my own data. The code uses the Microsoft SQL Helper.cs class.

Originally the code opened the page, and returned all the employees in the NW database. I ran the project and everything was fine.

Original code:
private void BindData()<br />
		{<br />
			 ds = new DataSet();<br />
			//ds= SqlHelper.ExecuteDataset(this.connectionString, "dbo.GetEmployees", null);<br />
			Session["ds"]=ds;<br />
			dt = ds.Tables[0];<br />
			Session["dt"]=dt;<br />
			DataGrid1.DataSource=dt;<br />
			DataGrid1.DataBind();<br />
			<br />
		}


I changed it to take a parameter. The user enters a part number in a text box, and clicks a search button and then I want the datagrid to populate. It returns 3 blank rows. When I went through the debugger it looks like it tries to run through the SQLHelper code before it looks at the button click function.

I think it has to do with how I'm sending the parameters but I'm not sure because if I change the stored procedure and code for no parameters, it works.
Current code:
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 />
			//ds=SqlHelper.ExecuteDataset(this.connectionString, CommandType.StoredProcedure, "dbo.GetPartInfoTest");<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 />
		}


Does anyone have any ideas? I didn't post the SQLHelper code as it is LONG but if someone is willing to help and needs it let me know.

Thanks again to all who help!
AnswerRe: Blank datagrid--parameter issue? Pin
led mike22-Jun-06 7:45
led mike22-Jun-06 7:45 
GeneralRe: Blank datagrid--parameter issue? Pin
leckey22-Jun-06 8:19
leckey22-Jun-06 8:19 
GeneralRe: Blank datagrid--parameter issue? Pin
Josh Smith22-Jun-06 8:37
Josh Smith22-Jun-06 8:37 
GeneralRe: Blank datagrid--parameter issue? Pin
leckey22-Jun-06 8:52
leckey22-Jun-06 8:52 
GeneralRe: Blank datagrid--parameter issue? Pin
led mike22-Jun-06 9:49
led mike22-Jun-06 9:49 
GeneralRe: Blank datagrid--parameter issue? Pin
Josh Smith22-Jun-06 10:01
Josh Smith22-Jun-06 10:01 
AnswerRe: Blank datagrid--parameter issue? Pin
Josh Smith22-Jun-06 7:52
Josh Smith22-Jun-06 7:52 
Questionhow to refresh or keep the graphics Pin
donkaiser22-Jun-06 6:37
donkaiser22-Jun-06 6:37 
AnswerRe: how to refresh or keep the graphics Pin
Dustin Metzgar22-Jun-06 6:49
Dustin Metzgar22-Jun-06 6:49 
GeneralRe: how to refresh or keep the graphics Pin
donkaiser22-Jun-06 7:05
donkaiser22-Jun-06 7:05 
GeneralRe: how to refresh or keep the graphics Pin
Dustin Metzgar22-Jun-06 7:33
Dustin Metzgar22-Jun-06 7:33 
AnswerRe: how to refresh or keep the graphics Pin
atuldeore22-Jun-06 7:16
atuldeore22-Jun-06 7:16 
QuestionA program to organize and fix data. Pin
Noah Moerbeek22-Jun-06 5:38
Noah Moerbeek22-Jun-06 5:38 
QuestionSelecting leaf node directly !!! Pin
ankushmn22-Jun-06 4:57
ankushmn22-Jun-06 4:57 
AnswerRe: Selecting leaf node directly !!! Pin
Dustin Metzgar22-Jun-06 5:07
Dustin Metzgar22-Jun-06 5:07 
QuestionIIS and Active directory Pin
engsrini22-Jun-06 4:52
engsrini22-Jun-06 4:52 
QuestionZip file creation in C# Pin
coolestCoder22-Jun-06 4:28
coolestCoder22-Jun-06 4:28 

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.