DataBinding: 'DatePickerControl.DatePicker' does not contain a property with the name 'Text' - c#

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" />

Related

Handling checkbox in <asp:ControlParameter> section of SqlDataSource

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!

ASP.NET Grid View edit with variables

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

Trying to insert data into database with sqldatasource, I get this error: ora-01745 invalid host exception, why?

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?

GridView update/delete crashes

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.

Gridview using sqldatasource

Im working using Gridview and Sqldatasource, so , when Im tried to use the updatecommand, but when I clicked on, nothing happen, so, if I save a new record and after click on update command button , so , it works well. do you have any idea about whats happening ?
the next is my code snipped
<asp:GridView ID="gvInfoCobradores" runat="server" CellPadding="4"
ForeColor="#333333" GridLines="None" AutoGenerateEditButton="True"
OnRowEditing="gvInfoAdmin_RowEditing" OnRowUpdating="gvInfoAdmin_RowUpdating"
DataSourceID="dsCobradorInfo" DataKeyNames="ID_Cobrador" Width="50%">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:CommandField ShowDeleteButton="True" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
</asp:GridView>
<asp:SqlDataSource ID="dsCobradorInfo" runat="server" ConnectionString="<%$ ConnectionStrings:SeminarioConnectionString %>"
SelectCommand="SELECT * FROM [UsuariosSistema].[Cobrador]"
OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues"
DeleteCommand="DELETE FROM [UsuariosSistema].[Cobrador] WHERE [ID_Cobrador] = #original_ID_Cobrador AND [NombreUsuarioCobrador] = #original_NombreUsuarioCobrador AND [PasswordCobrador] = #original_PasswordCobrador AND [NombreCobrador] = #original_NombreCobrador AND [ApellidoPaternoCobrador] = #original_ApellidoPaternoCobrador AND [ApellidoMaternoCobrador] = #original_ApellidoMaternoCobrador AND (([TelCobrador] = #original_TelCobrador) OR ([TelCobrador] IS NULL AND #original_TelCobrador IS NULL)) AND (([CelCobrador] = #original_CelCobrador) OR ([CelCobrador] IS NULL AND #original_CelCobrador IS NULL)) AND (([CorreElectronicoCobrador] = #original_CorreElectronicoCobrador) OR ([CorreElectronicoCobrador] IS NULL AND #original_CorreElectronicoCobrador IS NULL))"
InsertCommand="INSERT INTO [UsuariosSistema].[Cobrador] ([NombreUsuarioCobrador], [PasswordCobrador], [NombreCobrador], [ApellidoPaternoCobrador], [ApellidoMaternoCobrador], [TelCobrador], [CelCobrador], [CorreElectronicoCobrador]) VALUES (#NombreUsuarioCobrador, #PasswordCobrador, #NombreCobrador, #ApellidoPaternoCobrador, #ApellidoMaternoCobrador, #TelCobrador, #CelCobrador, #CorreElectronicoCobrador)"
UpdateCommand="UPDATE [UsuariosSistema].[Cobrador] SET [NombreUsuarioCobrador] = #NombreUsuarioCobrador, [PasswordCobrador] = #PasswordCobrador, [NombreCobrador] = #NombreCobrador, [ApellidoPaternoCobrador] = #ApellidoPaternoCobrador, [ApellidoMaternoCobrador] = #ApellidoMaternoCobrador, [TelCobrador] = #TelCobrador, [CelCobrador] = #CelCobrador, [CorreElectronicoCobrador] = #CorreElectronicoCobrador WHERE [ID_Cobrador] = #original_ID_Cobrador AND [NombreUsuarioCobrador] = #original_NombreUsuarioCobrador AND [PasswordCobrador] = #original_PasswordCobrador AND [NombreCobrador] = #original_NombreCobrador AND [ApellidoPaternoCobrador] = #original_ApellidoPaternoCobrador AND [ApellidoMaternoCobrador] = #original_ApellidoMaternoCobrador AND (([TelCobrador] = #original_TelCobrador) OR ([TelCobrador] IS NULL AND #original_TelCobrador IS NULL)) AND (([CelCobrador] = #original_CelCobrador) OR ([CelCobrador] IS NULL AND #original_CelCobrador IS NULL)) AND (([CorreElectronicoCobrador] = #original_CorreElectronicoCobrador) OR ([CorreElectronicoCobrador] IS NULL AND #original_CorreElectronicoCobrador IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_ID_Cobrador" Type="Int32" />
<asp:Parameter Name="original_NombreUsuarioCobrador" Type="String" />
<asp:Parameter Name="original_PasswordCobrador" Type="String" />
<asp:Parameter Name="original_NombreCobrador" Type="String" />
<asp:Parameter Name="original_ApellidoPaternoCobrador" Type="String" />
<asp:Parameter Name="original_ApellidoMaternoCobrador" Type="String" />
<asp:Parameter Name="original_TelCobrador" Type="String" />
<asp:Parameter Name="original_CelCobrador" Type="String" />
<asp:Parameter Name="original_CorreElectronicoCobrador" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="NombreUsuarioCobrador" Type="String" />
<asp:Parameter Name="PasswordCobrador" Type="String" />
<asp:Parameter Name="NombreCobrador" Type="String" />
<asp:Parameter Name="ApellidoPaternoCobrador" Type="String" />
<asp:Parameter Name="ApellidoMaternoCobrador" Type="String" />
<asp:Parameter Name="TelCobrador" Type="String" />
<asp:Parameter Name="CelCobrador" Type="String" />
<asp:Parameter Name="CorreElectronicoCobrador" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="NombreUsuarioCobrador" Type="String" />
<asp:Parameter Name="PasswordCobrador" Type="String" />
<asp:Parameter Name="NombreCobrador" Type="String" />
<asp:Parameter Name="ApellidoPaternoCobrador" Type="String" />
<asp:Parameter Name="ApellidoMaternoCobrador" Type="String" />
<asp:Parameter Name="TelCobrador" Type="String" />
<asp:Parameter Name="CelCobrador" Type="String" />
<asp:Parameter Name="CorreElectronicoCobrador" Type="String" />
<asp:Parameter Name="original_ID_Cobrador" Type="Int32" />
<asp:Parameter Name="original_NombreUsuarioCobrador" Type="String" />
<asp:Parameter Name="original_PasswordCobrador" Type="String" />
<asp:Parameter Name="original_NombreCobrador" Type="String" />
<asp:Parameter Name="original_ApellidoPaternoCobrador" Type="String" />
<asp:Parameter Name="original_ApellidoMaternoCobrador" Type="String" />
<asp:Parameter Name="original_TelCobrador" Type="String" />
<asp:Parameter Name="original_CelCobrador" Type="String" />
<asp:Parameter Name="original_CorreElectronicoCobrador" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
Thanks in advance!!

Categories

Resources