473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I use GridView or DetailsView to Bind to a DataSet

I use this code

SqlDataSource1.SelectParameters.Add("F_Employer", TypeCode.String, _ txtSearch.Text)
SqlDataSource1.SelectCommand = "ALLV_Employer"

but I recive this error in the execution time

System.Data.SqlClient.SqlException: Procedure or Function 'ALLV_Employer' expects parameter '@F_Employer', which was not supplied.

Please help me.
Oct 31 '06 #1
2 4308
I use this code

SqlDataSource1.SelectParameters.Add("F_Employer", TypeCode.String, _ txtSearch.Text)
SqlDataSource1.SelectCommand = "ALLV_Employer"

but I recive this error in the execution time

System.Data.SqlClient.SqlException: Procedure or Function 'ALLV_Employer' expects parameter '@F_Employer', which was not supplied.

Please help me.
plz would u like to tell the version u r using of .net
Mar 29 '07 #2
plz would u like to tell the version u r using of .net
Hi,

I also having the same problem.
Here is the code im using. Im using hyperlink in gridview to get the data to update form.
im using .net 2008 with c#.

please anyone can help me?

Expand|Select|Wrap|Line Numbers
  1. SqlConnection conn = new SqlConnection("Data Source=MIS_HP;Initial Catalog=DBhelpdesk;User ID=sa;Password=sapassword");
  2.         conn.Open();
  3.         SqlCommand comm = new SqlCommand("SelectUserByStaffID", conn);
  4.         comm.CommandType = CommandType.StoredProcedure;
  5.  
  6.         comm.Parameters.AddWithValue("@StaffID", Request.QueryString["StaffID"]);
  7.         SqlDataReader rdr2 = comm.ExecuteReader();
  8.  
  9.         while (rdr2.Read() && !rdr2.IsDBNull(0))
  10.         {
  11.             tbUserID.Text = Convert.ToString(rdr2["StaffID"]);
  12.             tbFullName.Text = (string)rdr2["StaffFullName"];
  13.             tbName.Text = (string)rdr2["StaffName"];
  14.             tbPassword.Text = (string)rdr2["StaffPassword"];
  15.             ddlLevel.Text = (string)rdr2["StaffLevel"];
  16.             rbAutoAssign.SelectedValue = Convert.ToString(rdr2["AutoRotation"]);
  17.             tbEmail.Text = (string)rdr2["StaffEmail"];
  18.         }
  19.         rdr2.Close();
  20.         conn.Close();
Regards,
Meshack
Aug 6 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: P. Yanzick | last post by:
Hello, I've been playing with master/detail views as well as editing in the gridview, and I ran across a strange problem that I am not exactly sure where to go to try to solve. I have 2...
0
by: jeffmagill | last post by:
Hi Everybody, I'm really hoping that someone can help me out because I have spent too much time on this project already! Basically, I have a DetailsView that handles all the Edits for a...
5
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
2
by: Greg | last post by:
Hello, I am trying to bind a GridView to a custom object I have created. First, here is what I'm trying to do: I have a wizard for adding/editing Users. When the wizard begins, a User...
4
by: Tomasz Jastrzebski | last post by:
Hello Everyone, I have a GridView control bound to a plain DataTable object. AutoGenerateEditButton is set to true, Edit button gets displayed, and RowEditing event fires as expected.
4
by: Tomasz | last post by:
Hello Developers, Here is interesting problem I just came across: how do I wire a GridView control programmatically? Here is my sample code using Object Data Source: protected void...
3
by: Dariusz Tomon | last post by:
Hello, I have GridView in EditItem Template of DetailsView (in normal - read-only mode there is a label). When I'm in edit mode I can select one item from GridView. The main problem is that as...
1
by: needhelp1 | last post by:
I have gridview with a detailsview below. When I click on 'New' in brings up the DetailsView for inserting. When I click on 'Edit' in does not brink up the DetailsView. What am I doing wrong? I...
0
by: troydixon | last post by:
Hello, I am new at this, and have been trying to insert data into a table by using the footer of a gridview (which I dont like) or by using a detials view on the same page that is doing the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.