I'm reusing some code that I've had a lot of success with on other pages and the only significant difference here is that I'm capturing the value of a Checkbox in the filter panel that I haven't done in the past. Code sample is provided below, but the crux of what I'm running into is that I can't seem to find an acceptable set of parameters for the listed under the within the SqlDataSource.
What it throws is this: "The data types varchar and bit are incompatible in the add operator."
This is when I'm using Type="Boolean" in the asp:ControlParameter. I've tried numerious Types and other syntax within the asp:ControlParameter with no success.
<%--From the filter pannel--%>
<%--The SqlDataSource--%>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" CancelSelectOnNullParameter="false" ConnectionString='<%$ ConnectionStrings:csrConnectionString %>' DeleteCommand="DELETE FROM [csr_refdata_ip360_HostVulnerabilityCSV] WHERE [RecID] = #RecID" InsertCommand="INSERT INTO [csr_refdata_ip360_HostVulnerabilityCSV] ([DNS Name], [NetBIOS Name], [IP], [OS], [Vulnerability Score], [Vulnerability], [Vulnerability ID], [TicketNumber], [TicketClosed], [AssetID], [ExceptionID], [Notes]) VALUES (#DNS_Name, #NetBIOS_Name, #IP, #OS, #Vulnerability_Score, #Vulnerability, #Vulnerability_ID, #TicketNumber, #TicketClosed, #AssetID, #ExceptionID, #Notes)" SelectCommand="SELECT RecID, [DNS Name] AS DNS_Name, [NetBIOS Name] AS NetBIOS_Name, IP, OS, [Vulnerability Score] AS Vulnerability_Score, Vulnerability, [Vulnerability ID] AS Vulnerability_ID, TicketNumber, TicketClosed, AssetID, ExceptionID, Notes FROM csr_refdata_ip360_HostVulnerabilityCSV WHERE (Excepted = #Excepted) AND (RTRIM(LTRIM(ISNULL(#RecID, ''))) = '' OR RecID LIKE '%' + #RecID + '%') AND (RTRIM(LTRIM(ISNULL(#DNS_Name, ''))) = '' OR [DNS Name] LIKE '%' + #DNS_Name + '%') AND (RTRIM(LTRIM(ISNULL(#NetBIOS_Name, ''))) = '' OR [NetBIOS Name] LIKE '%' + #NetBIOS_Name + '%') AND (RTRIM(LTRIM(ISNULL(#IP, ''))) = '' OR IP LIKE '%' + #IP + '%') AND (RTRIM(LTRIM(ISNULL(#OS, ''))) = '' OR OS LIKE '%' + #OS + '%') AND (RTRIM(LTRIM(ISNULL(#Vulnerability_Score, ''))) = '' OR [Vulnerability Score] LIKE '%' + #Vulnerability_Score + '%') AND (RTRIM(LTRIM(ISNULL(#Vulnerability, ''))) = '' OR Vulnerability LIKE '%' + #Vulnerability + '%') AND (RTRIM(LTRIM(ISNULL(#Vulnerability_ID, ''))) = '' OR [Vulnerability ID] LIKE '%' + #Vulnerability_ID + '%') AND (RTRIM(LTRIM(ISNULL(#TicketNumber, ''))) = '' OR TicketNumber LIKE '%' + #TicketNumber + '%') AND (RTRIM(LTRIM(ISNULL(#TicketClosed, ''))) = '' OR TicketClosed LIKE '%' + #TicketClosed + '%') AND (RTRIM(LTRIM(ISNULL(#Notes, ''))) = '' OR Notes LIKE '%' + #Notes + '%') AND (RTRIM(LTRIM(ISNULL(#AssetID, ''))) = '' OR AssetID LIKE '%' + #AssetID + '%') AND (RTRIM(LTRIM(ISNULL(#ExceptionID, ''))) = '' OR ExceptionID LIKE '%' + #ExceptionID + '%') ORDER BY Vulnerability_Score DESC, Vulnerability, NetBIOS_Name" UpdateCommand="UPDATE [csr_refdata_ip360_HostVulnerabilityCSV] SET [DNS Name] = #DNS_Name, [NetBIOS Name] = #NetBIOS_Name, [IP] = #IP, [OS] = #OS, [Vulnerability Score] = #Vulnerability_Score, [Vulnerability] = #Vulnerability, [Vulnerability ID] = #Vulnerability_ID, [TicketNumber] = #TicketNumber, [TicketClosed] = #TicketClosed, [AssetID] = #AssetID, [ExceptionID] = #ExceptionID, [Notes] = #Notes WHERE [RecID] = #RecID">
<DeleteParameters>
<asp:Parameter Name="RecID" Type="Int32"></asp:Parameter>
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="DNS_Name" Type="String"></asp:Parameter>
<asp:Parameter Name="NetBIOS_Name" Type="String"></asp:Parameter>
<asp:Parameter Name="IP" Type="String"></asp:Parameter>
<asp:Parameter Name="OS" Type="String"></asp:Parameter>
<asp:Parameter Name="Vulnerability_Score" Type="Int16"></asp:Parameter>
<asp:Parameter Name="Vulnerability" Type="String"></asp:Parameter>
<asp:Parameter Name="Vulnerability_ID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="TicketNumber" Type="Int32"></asp:Parameter>
<asp:Parameter Name="TicketClosed" Type="Boolean"></asp:Parameter>
<asp:Parameter Name="AssetID" Type="Int64"></asp:Parameter>
<asp:Parameter Name="ExceptionID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Notes" Type="String"></asp:Parameter>
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="N" Name="Excepted" Type="String"></asp:Parameter>
<asp:ControlParameter Name="RecID" ControlID="RecID_Tbx" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="DNS_Name" ControlID="DNSName_Tbx" Type="String" ConvertEmptyStringToNull="true"/>
<asp:ControlParameter Name="NetBIOS_Name" ControlID="NetBIOSName_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="IP" ControlID="IP_Tbx" Type="String" ConvertEmptyStringToNull="true"/>
<asp:ControlParameter Name="OS" ControlID="OS_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability_Score" ControlID="Vulnerability_Tbx" Type="Int16" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability" ControlID="Vulnerability_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability_ID" ControlID="VulnerabilityID_Tbx" Type="Int32" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="TicketNumber" ControlID="TicketNum_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<%--<%--<%-- This is the problem line below --%>--%>--%>
<asp:ControlParameter Name="TicketClosed" ControlID="TicketClosed_ChBox" Type="Boolean" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Notes" ControlID="Notes_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="AssetID" ControlID="AssetID_Tbx" Type="Int64" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="ExceptionID" ControlID="ExceptionID_Tbx" Type="String" ConvertEmptyStringToNull="true" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="DNS_Name" Type="String"></asp:Parameter>
<asp:Parameter Name="NetBIOS_Name" Type="String"></asp:Parameter>
<asp:Parameter Name="IP" Type="String"></asp:Parameter>
<asp:Parameter Name="OS" Type="String"></asp:Parameter>
<asp:Parameter Name="Vulnerability_Score" Type="Int16"></asp:Parameter>
<asp:Parameter Name="Vulnerability" Type="String"></asp:Parameter>
<asp:Parameter Name="Vulnerability_ID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="TicketNumber" Type="Int32"></asp:Parameter>
<asp:Parameter Name="TicketClosed" Type="Boolean"></asp:Parameter>
<asp:Parameter Name="AssetID" Type="Int64"></asp:Parameter>
<asp:Parameter Name="ExceptionID" Type="Int32"></asp:Parameter>
<asp:Parameter Name="Notes" Type="String"></asp:Parameter>
<asp:Parameter Name="RecID" Type="Int32"></asp:Parameter>
</UpdateParameters>
</asp:SqlDataSource>
Any insight on how I can stuff this checkbox into my ControlParameter properly would be greatly appreciated. I've pretty much exhausted my ideas.
I ended up altering the db table changing the column to varchar(1) so that I could set all BoundFields in the gridview. Then updated my to:
<SelectParameters>
<asp:Parameter DefaultValue="N" Name="Excepted" Type="String"></asp:Parameter>
<asp:ControlParameter Name="RecID" ControlID="RecID_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="DNS_Name" ControlID="DNSName_Tbx" Type="String" ConvertEmptyStringToNull="true"/>
<asp:ControlParameter Name="NetBIOS_Name" ControlID="NetBIOSName_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="IP" ControlID="IP_Tbx" Type="String" ConvertEmptyStringToNull="true"/>
<asp:ControlParameter Name="OS" ControlID="OS_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability_Score" ControlID="VulnerabilityScore_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability" ControlID="Vulnerability_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Vulnerability_ID" ControlID="VulnerabilityID_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="TicketNumber" ControlID="TicketNum_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="TicketClosed" ControlID="TicketClosed_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="Notes" ControlID="Notes_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="AssetID" ControlID="AssetID_Tbx" Type="String" ConvertEmptyStringToNull="true" />
<asp:ControlParameter Name="ExceptionID" ControlID="ExceptionID_Tbx" Type="String" ConvertEmptyStringToNull="true" />
Everything is working fine now....
MethodMan, thanks for your input! This one is done!
Related
When editing certain column values in my gridview, other values need to change depending on that value.
For example: http://i.imgur.com/phfVtUq.png
When editing the Truck Diesel column value, the KMPerLiter and RandsPerKM values must be changed according to that value and visa versa. The formulas are as follows:
KMPerLiter = TotaKM/TruckDiesel+TrailerDiesel and RandsPerKM = Amount/TotalKM.
This must be done within the edit column of the gridview.
All these values are then stored in a table in a database.
Here is the ASP.Net html source code:
UpdateCommand="UPDATE [Loads] SET [loadDate] = #loadDate, [loadDay] = #loadDay, [loadClient] = #loadClient, [loadDriver] = #loadDriver, [loadLoadingPoint1] = #loadLoadingPoint1, [loadLoadingPoint2] = #loadLoadingPoint2, [loadLoadingPoint3] = #loadLoadingPoint3, [loadOffloadingPoint1] = #loadOffloadingPoint1, [loadOffloadingPoint2] = #loadOffloadingPoint2, [loadOffloadingPoint3] = #loadOffloadingPoint3, [loadStops] = #loadStops, [loadNumber] = #loadNumber, [loadPodNumber] = #loadPodNumber, [loadAmount] = #loadAmount, [loadTruckReg] = #loadTruckReg, [loadTrailerReg] = #loadTrailerReg, [loadCategory] = #loadCategory, [loadDayOut] = #loadDayOut, [loadNightOut] = #loadNightOut, [loadOdoStart] = #loadOdoStart, [loadOdoEnd] = #loadOdoEnd, [loadTruckDiesel] = #loadTruckDiesel, [loadTrailerDiesel] = #loadTrailerDiesel, [loadInvoiceNumber] = #loadInvoiceNumber, [loadReceiptNumber] = #loadReceiptNumber, [loadKMperLiter] = #loadKMperLiter, [loadRandsPerKM] = #loadRandsPerKM, [loadDriverWage] = #loadDriverWage, [clientRecieved] = #clientRecieved, [loadTotalKM] = #loadTotalKM, [note] = #note WHERE [loadID] = #loadID">
<UpdateParameters>
<asp:Parameter DbType="Date" Name="loadDate" />
<asp:Parameter Name="loadDay" Type="String" />
<asp:Parameter Name="loadClient" Type="String" />
<asp:Parameter Name="loadDriver" Type="String" />
<asp:Parameter Name="loadLoadingPoint1" Type="String" />
<asp:Parameter Name="loadLoadingPoint2" Type="String" />
<asp:Parameter Name="loadLoadingPoint3" Type="String" />
<asp:Parameter Name="loadOffloadingPoint1" Type="String" />
<asp:Parameter Name="loadOffloadingPoint2" Type="String" />
<asp:Parameter Name="loadOffloadingPoint3" Type="String" />
<asp:Parameter Name="loadStops" Type="Int32" />
<asp:Parameter Name="loadNumber" Type="String" />
<asp:Parameter Name="loadPodNumber" Type="String" />
<asp:Parameter Name="loadAmount" Type="Decimal" />
<asp:Parameter Name="loadTruckReg" Type="String" />
<asp:Parameter Name="loadTrailerReg" Type="String" />
<asp:Parameter Name="loadCategory" Type="String" />
<asp:Parameter Name="loadDayOut" Type="Int32" />
<asp:Parameter Name="loadNightOut" Type="Int32" />
<asp:Parameter Name="loadOdoStart" Type="Int32" />
<asp:Parameter Name="loadOdoEnd" Type="Int32" />
<asp:Parameter Name="loadTruckDiesel" Type="Decimal" />
<asp:Parameter Name="loadTrailerDiesel" Type="Decimal" />
<asp:Parameter Name="loadInvoiceNumber" Type="String" />
<asp:Parameter Name="loadReceiptNumber" Type="String" />
<asp:Parameter Name="loadKMperLiter" Type="Decimal" />
<asp:Parameter Name="loadRandsPerKM" Type="Decimal" />
<asp:Parameter Name="loadDriverWage" Type="Int32" />
<asp:Parameter Name="clientRecieved" Type="String" />
<asp:Parameter Name="loadTotalKM" Type="Int32" />
<asp:Parameter Name="note" Type="String" />
<asp:Parameter Name="loadID" Type="Int32" />
</UpdateParameters>
Thanks in advance!
Method 1:
Creating Stored Procedure
Create Proc _SPUpdateTableName
#id int,
#truckvalue numeric(18,0)
as
begin
Update TableName set KMPerLiter = TotaKM/(#truckvalue+TrailerDiesel) , TruckDiesel = #truckvalue where ID =#id
end
On SqlDataSource code :
<asp:SqlDataSource ID="LocalServerDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" UpdateCommand="_SPUpdateTableName" UpdateCommandType="StoredProcedure">
<UpdateParameters>
<asp:Parameter Name="id" Type="Int32" />
<asp:Parameter Name="truckvalue " Type="Decimal" />
</UpdateParameters>
</asp:SqlDataSource>
Or Else in RowUpdate Method you can calculate the parameters and assign them to your UpdateCommand statement Parameter :
Method 2:
protected void grdvechile_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
try
{
decimal truckvalue= Convert.ToDecimal( grdvechile.Rows[e.RowIndex].Cells[1].Text);
// fetch all value as needed and typecast
decimal KMPerLiter = TotaKM/(truckvalue+TrailerDiesel);
//Pass your required parameter
LocalServerDataSource.UpdateParameters["truckvalue"].DefaultValue = truckvalue;
LocalServerDataSource.UpdateParameters["KMPerLiter "].DefaultValue = KMPerLiter ;
LocalServerDataSource.Update();
}
catch { }
}
Note: These code is only on logic I thought will be appicable for your situation not tested.Change as per your Requirment.
No need.. Only create a virtual table to pick up the Grid view value, Then change it according to your requirement, again reassign it to Grid view
I have this code in my aspx file:
<asp:SqlDataSource ID="RegisterUserSQL" runat="server" ConnectionString="<%$ ConnectionStrings:UserQueries %>" ProviderName="<%$ ConnectionStrings:UserQueries.ProviderName %>"
InsertCommand="insert into users (firstname, lastname, username, password, email, gender, birthdate, nationality, currentcity)
values (:firstname, :lastname, :username, :password, :email, :gender, :date, :nationality, :currentcity)">
<InsertParameters>
<asp:Parameter Name="firstname" Type="String" />
<asp:Parameter Name="lastname" Type="String" />
<asp:Parameter Name="username" Type="String" />
<asp:Parameter Name="password" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="gender" Type="Char" />
<asp:Parameter Name="date" Type="String" />
<asp:Parameter Name="nationality" Type="String" />
<asp:Parameter Name="currentcity" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
Then this is the code behind:
RegisterUserSQL.InsertParameters["firstname"].DefaultValue = SavedFirstnameBox.Text;
RegisterUserSQL.InsertParameters["lastname"].DefaultValue = SavedLastnameBox.Text;
RegisterUserSQL.InsertParameters["username"].DefaultValue = SavedUsernameBox.Text;
RegisterUserSQL.InsertParameters["password"].DefaultValue = SavedPasswordBox.Text;
RegisterUserSQL.InsertParameters["email"].DefaultValue = SavedEmailBox.Text;
RegisterUserSQL.InsertParameters["gender"].DefaultValue = SavedGenderBox.Text;
RegisterUserSQL.InsertParameters["date"].DefaultValue = BirthdateBox.Text;
RegisterUserSQL.InsertParameters["nationality"].DefaultValue = SavedNationalityBox.Text;
RegisterUserSQL.InsertParameters["currentcity"].DefaultValue = SavedCurrentCityBox.Text;
RegisterUserSQL.Insert();
It stops at the last insert() statement and gives the error.
Any suggestions?
I have a gridview of my table. I established a AccsessDataSource to my database. The Accsess datasource is configured so the sql scentance is: SELECT * FROM [Users] In the advanced settings I checked "Generate INSERT, UPDATE, and delete statements" I enabled editing and deleting. My source code shows this:
<asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/RunRunDB.mdb"
DeleteCommand="DELETE FROM [Users] WHERE (([username] = ?) OR ([username] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [Users] ([Fname], [Lname], [Email], [Bday], [pswrd], [admin], [username]) VALUES (?, ?, ?, ?, ?, ?, ?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT * FROM [Users]"
UpdateCommand="UPDATE [Users] SET [Fname] = ?, [Lname] = ?, [Email] = ?, [Bday] = ?, [pswrd] = ?, [admin] = ? WHERE (([username] = ?) OR ([username] IS NULL AND ? IS NULL))">`
<DeleteParameters>
<asp:Parameter Name="original_username" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Fname" Type="String" />
<asp:Parameter Name="Lname" Type="String" />
<asp:Parameter Name="Email" Type="String" />
<asp:Parameter Name="Bday" Type="DateTime" />
<asp:Parameter Name="pswrd" Type="String" />
<asp:Parameter Name="admin" Type="Boolean" />
<asp:Parameter Name="username" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Fname" Type="String" />
<asp:Parameter Name="Lname" Type="String" />
<asp:Parameter Name="Email" Type="String" />
<asp:Parameter Name="Bday" Type="DateTime" />
<asp:Parameter Name="pswrd" Type="String" />
<asp:Parameter Name="admin" Type="Boolean" />
<asp:Parameter Name="original_username" Type="String" />
</UpdateParameters>
</asp:AccessDataSource>
Each time i run my website i get an error that says: You do not have a value for one or more of the required parameters.
Thanks..
Your problem is here:
WHERE (([username] = ?) OR ([username] IS NULL AND ? IS NULL))
Command parameters cannot be used to specify table or column (field) names; they only specify column values. You will have to adjust your UpdateCommand and DeleteCommand strings to specify the column name explicitly.
I have a GridView that shows all the registed users and some of their information and when you choose the "select" link off the side, it shows a DetailsView with all the details related to that user. The select works fine and updates the details view for the selected user, and when I try to edit the DetailsView, it will update the database and fill in the information updated for ALL the users when changing the fields (eg. if I change the customers first name, everyone registered will get that name). Here's my aspx code for my SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT * FROM [UserProfile] ORDER BY [Email], [LastName], [Company]"
UpdateCommand="UPDATE [UserProfile] SET [LastName] = #LastName, [PartsList] = #PartsList, [UserName] = #UserName, [Question] = #Question,
[Answer] = #Answer, [Role] = #Role
WHERE [FirstName] = FirstName AND [Company] = Company">
<UpdateParameters>
<asp:Parameter Name="FirstName" Type="String" />
<asp:Parameter Name="LastName" Type="String" />
<asp:Parameter Name="Company" Type="String" />
<asp:Parameter Name="PartsList" Type="String" />
<asp:Parameter Name="UserName" Type="String" />
<asp:Parameter Name="Password" Type="String" />
<asp:Parameter Name="Email" Type="String" />
<asp:Parameter Name="Question" Type="String" />
<asp:Parameter Name="Answer" Type="String" />
<asp:Parameter Name="Role" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
You forgot #original_ in your Where parameters
Change UpdateCommand to:
UPDATE [UserProfile] SET [LastName] = #LastName, [PartsList] = #PartsList, [UserName] = #UserName, [Question] = #Question,
[Answer] = #Answer, [Role] = #Role
WHERE [FirstName] = #original_FirstName AND [Company] = #original_Company
I tried using date/time, time, but it doesn't help.
Exception Details: System.Web.HttpException: DataBinding: 'DatePickerControl.DatePicker' does not contain a property with the name 'Text'.
Source Error:
Line 31: DataSource.InsertParameters.Add("UserId", UserGUID.ToString());
Line 32:
Line 33: DataSource.Insert();//here is the error
Line 34:
Line 35: }
Here is the html code :
<asp:SqlDataSource ID="InsertExtraInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
InsertCommand="INSERT INTO [UserDetails] ([UserId], [CustName], [CustNum], [CustRole], [CustStatus], [PName], [PEmail], [PRole], [WedDate]) VALUES (#UserId, #CustName, #CustNum, #CustRole, #CustStatus, #PName, #PEmail, #PRole, #WedDate)"
ProviderName="<%$ ConnectionStrings:ASPNETDBConnectionString1.ProviderName %>">
<InsertParameters>
<asp:ControlParameter Name="CustName" Type="String" ControlID="CustName" PropertyName="Text" />
<asp:ControlParameter Name="CustNum" Type="String" ControlID="CustNum" PropertyName="Text" />
<asp:ControlParameter Name="CustRole" Type="String" ControlID="CustRole" PropertyName="Text" />
<asp:ControlParameter Name="CustStatus" Type="String" ControlID="CustStatus" PropertyName="Text" />
<asp:ControlParameter Name="PName" Type="String" ControlID="PName" PropertyName="Text" />
<asp:ControlParameter Name="PEmail" Type="String" ControlID="PEmail" PropertyName="Text" />
<asp:ControlParameter Name="PRole" Type="String" ControlID="PRole" PropertyName="Text" />
<asp:ControlParameter Name="WedDate" Type="String" ControlID="WedDate" PropertyName="Text"/>
</InsertParameters>
</asp:SqlDataSource>
Set PropertyName="SelectedValue" and Type="DateTime"
<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedValue"/>
EDIT:
try
<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate"/>
Change
Type="String" to Type="DateTime" and
PropertyName="Text" to PropertyName="SelectedDate"
on this line
<asp:ControlParameter Name="WedDate" Type="DateTime" ControlID="WedDate" PropertyName="SelectedDate" />