Gridview/DropDownList problem. Simple problem, I think [modified]
-
Hey guys, I'm having a little problem with my drop down list and gridview. I used the drop down list to select what data is going to be shown in the gridview, it was working fine earlier but I changed the SQL string around a little bit and it went all haywire. Usually I back up my data every few hours, but just as my luck would have it, last time I backed up was right before I started that form. The error I'm getting is "Must declare the scalar variable "@Name".", but I thought it was declared, I must have a line left out in the drop down list settings. Here is the code that I think matters. If I'm leaving any out please let me know!
Thanks, aqzman Edit: Just thought this might help elimate some problems. When I run this code without the "AND tblUsers.Name = @Name" code the gridview and drop down list both fill up with all the data they need to, but obvisiouly none of the data in the gridview is filtered
-
Hey guys, I'm having a little problem with my drop down list and gridview. I used the drop down list to select what data is going to be shown in the gridview, it was working fine earlier but I changed the SQL string around a little bit and it went all haywire. Usually I back up my data every few hours, but just as my luck would have it, last time I backed up was right before I started that form. The error I'm getting is "Must declare the scalar variable "@Name".", but I thought it was declared, I must have a line left out in the drop down list settings. Here is the code that I think matters. If I'm leaving any out please let me know!
Thanks, aqzman Edit: Just thought this might help elimate some problems. When I run this code without the "AND tblUsers.Name = @Name" code the gridview and drop down list both fill up with all the data they need to, but obvisiouly none of the data in the gridview is filtered
-
Hi, thanks a lot for your reply! I never changed any code with the dropdownlist, and that's where I thought where the value was getting assigned to @Name. I just noticed that not all the code for the drop down list is getting displayed in my first post for some reason. Here is the drop down list code.
-
Hi, thanks a lot for your reply! I never changed any code with the dropdownlist, and that's where I thought where the value was getting assigned to @Name. I just noticed that not all the code for the drop down list is getting displayed in my first post for some reason. Here is the drop down list code.
-
Thanks again for the reply. Well this is actually sort of strange, but good at the same time I guess. I made of copy of that page when it was working and it was saved in a folder, so I forgot about it. Anyway, that page is working fine, but the strangest thing is that I carried over all the code, and even checked the settings, they all match. One works, and the other doesn't. There is no value getting put into the @name on either page, the only time the actual phrase "@Name" is being used is in the selet query. Should I just write some code to assign the currently selected item in the drop down list to the @Name instead of just wondering how one page works? Haha. Thanks, aqzman
-
Thanks again for the reply. Well this is actually sort of strange, but good at the same time I guess. I made of copy of that page when it was working and it was saved in a folder, so I forgot about it. Anyway, that page is working fine, but the strangest thing is that I carried over all the code, and even checked the settings, they all match. One works, and the other doesn't. There is no value getting put into the @name on either page, the only time the actual phrase "@Name" is being used is in the selet query. Should I just write some code to assign the currently selected item in the drop down list to the @Name instead of just wondering how one page works? Haha. Thanks, aqzman
-
What i would say first leave the form with its functionality working then start your research and try to pass the value. But strange though!!!:omg:
Gautham
-
Hey guys, I'm having a little problem with my drop down list and gridview. I used the drop down list to select what data is going to be shown in the gridview, it was working fine earlier but I changed the SQL string around a little bit and it went all haywire. Usually I back up my data every few hours, but just as my luck would have it, last time I backed up was right before I started that form. The error I'm getting is "Must declare the scalar variable "@Name".", but I thought it was declared, I must have a line left out in the drop down list settings. Here is the code that I think matters. If I'm leaving any out please let me know!
Thanks, aqzman Edit: Just thought this might help elimate some problems. When I run this code without the "AND tblUsers.Name = @Name" code the gridview and drop down list both fill up with all the data they need to, but obvisiouly none of the data in the gridview is filtered
SelectCommand=" Declare @Name varchar SELECT *FROM tblCallers, tblTicket, tblUsersWHERE tblTicket.TicketID = tblCallers.TicketID AND tblTicket.UserID = tblUsers.UserID AND tblUsers.Name = @Name";
I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--