View Complete Post
Hi guys. I have gried view that shows me all info from the table i
made. So my SelectCommand works fine. I'v add 3 additional buttons
"new", "edit" and "delete" i'v made their query
but still have mistake by clicking it in browser. I follow from the book
Begginer to Novice 3.5 ASP C# but that's what it's shown. I know something
missing. I'v check in the net but not found how to fixed, because i use
SqlDataSource. Can you advise how to proceed from here? Here's what i did:
<asp:SqlDataSource ID="SqlDataSource5" runat="server" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:ThisIsMyConnection%>"
= "SELECT * FROM
[Resident] WHERE (([FNAME] + ' ' + [LNAME] LIKE '%' + @FANDLNAME + '%'))"
Resident SET FNAME=@FNAME, LNAME=@LNAME, MobileNum=@MobileNum,
HomeNum=@HomeNum, OfficeNum=@OfficeNum, FaxNum=@FaxNum WHERE FNAME=@original_FNAME
In my Girdview, I set: AutoGenerateDeleteButton="True" , and AutoGenerateEditButton="True".
The Buttons show at the first column of the gridview, how can move them to the last column?
Can't tell what is wrong here . It worked fine and I didn't did anything special in code-behind
I don't see any error just the same data in gridview
" SelectCommand="SELECT [Date], [InitEmployee], [AmitName], [AgentcyName], [Broker], [MobileNumber], [TZ], [Reason], [CareDate], [Status], [Notes], [CareAgent] FROM [ClientsDmeiNihulRequests] ORDER BY [Date] DESC" ConflictDetection="OverwriteChanges" DeleteCommand="DELETE FROM [ClientsDmeiNihulRequests] WHERE [Date] = @original_Date AND [TZ] = @original_TZ AND (([InitEmployee] = @original_InitEmployee) OR ([InitEmployee] IS NULL AND @original_InitEmployee IS NULL)) AND (([AmitName] = @original_AmitName) OR ([AmitName] IS NULL AND @original_AmitName IS NULL)) AND (([AgentcyName] = @original_AgentcyName) OR ([AgentcyName] IS NULL AND @original_AgentcyName IS NULL)) AND (([Broker] = @original_Broker) OR ([Broker] IS NULL AND @original_Broker IS NULL)) AND (([MobileNumber] = @original_MobileNumber) OR ([MobileNumber] IS NULL AND @original_MobileNumber IS NULL)) AND (([Reason] = @original_Reason) OR ([Reason] IS NULL AND @original_Reason IS NULL)) AND (([CareDate] = @original_CareDate) OR ([CareDate] IS NULL AND @original_CareDate IS NULL)) AND (([Status] = @original_Status) OR ([Status] IS NULL AND @original_Status IS NULL)) AND (([Notes] = @original_Notes) OR ([Not
using Asp.net c#
i am searching a record from my database and displaying it in gridview now i want the comments should be updated as per the record which is being searched
For E.g if record No.3 is searched then only i can update record no.3 and i don't want rest of data to be shown
now what is happening when i click on edit my whole table is being displayed
this is bcuz i made one method gridfill() which i m calling everytime if i m doing grid row editing,row cancelling and row updating
how i can resolve this thing
protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
GridView2.EditIndex = e.NewEditIndex;
protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
string id = GridView2.Rows[e.RowIndex].Cells.Text;
t = (TextBox)GridView2.Rows[e.RowIndex].Cells.Controls;
string query = "update user1 set comments=@comments where id=@id";
SqlConnection con = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(query, con);