User Control problem

c0ry98

Newcomer
Joined
Mar 16, 2004
Messages
1
I would like to store 4 buttons in a user control and call it on a dozen or so web forms. Two of the buttons execute queries against Oracle using information selected in drop down menus on the web form. Each page may have different drop down menus therefore I have a buildSQL function that I plan to have in every web form. This function will get all the values from the dropdown menus and construct a SQL statement. I need to construct the SQL statement when either of the two buttons is clicked. So I did the following:
In the web form DischargeFilterv2.aspx
public string buildSQL(string sNumRows)
{

return <SQL STATEMENT HERE>
}

In the DnldData.ascx user control
private void btnDwnldComma_Click(object sender, System.EventArgs e)
{
test.DischargeFilter2 df = new DischargeFilter2();
createFile(",",df.buildSQL(null),"c:/inetpub/wwwroot/test/test.txt").ToString();
}


This code compiles but when I click on the Download Comma button I receive the following error:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Any help will be greatly appreciated.

Thanks
Cory
 
first the function btnDwnldComma_Click has no 'handles' after it.

I think the problem is from the createFile function, what does it return?
 
Back
Top