|
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<span onclick="return confirm('Are you sure to Delete the record?')">
<asp:LinkButton ID="lnkB" runat="Server" Text="Delete" CommandName="Delete"></asp:LinkButton>
</span>
</ItemTemplate>
</asp:TemplateField>
Try this ......
|
|
|
|
|
i have this below problem while executing a transaction.
I am trying to insert into two different tables with differnt values on the same btn_click event.It is taking the second table value not the first table
I am posting my code here-----
Dim mycommand As New SqlCommand
Dim myTrans As SqlTransaction
myTrans = myconnection.BeginTransaction()
mycommand.Connection = myconnection
mycommand.Transaction = myTrans
Try
mycommand.CommandText = "insert into tbl_student(st_cd)values(1)"
mycommand.CommandText = "insert into mst_year([Year],Start_Date,End_Date,year1)values('2002-2003','4/1/2002','4/12/2002','2005')"
mycommand.ExecuteNonQuery()
myTrans.Commit()
Catch ex As Exception
myTrans.Rollback()
Response.Write(ex.Message)
Finally
myconnection.Close()
End Try
In the above code values are insertig in mst_year table only,not in tbl_student.
I want to save in both tables.how it can be done?
kissy
|
|
|
|
|
Surely this
Kissy16 wrote: mycommand.CommandText = "insert into tbl_student(st_cd)values(1)"
is causing your problem...
We are not a Code Charity
|
|
|
|
|
thanks for ur response.
so what to do to solve my problem.suggest me with some example so that i can use transaction to insert values into differnt tables.
plzz help me out.
thanks in advance.
kissy
|
|
|
|
|
How can i get a snapshot image from a video file programatically? e.g. get the first frame of the video file.
Is there any free library i can import? in .net with c#
|
|
|
|
|
|
still putting question as their subject
We are not a Code Charity
|
|
|
|
|
namespace for following this one? using .net with c#
mPlayerWrapper mPlayerInstance = new mPlayerWrapper();
|
|
|
|
|
Still putting question as a subject
We are not a Code Charity
|
|
|
|
|
|
Hi All,
i have a requirement to change the language of my webpage at runtime by hitting on language buttons. i have gone through this article.
http://www.codeproject.com/KB/aspnet/DynamicWebMultiLanguages.aspx
i have one doubt in this. In this article they used resource files for each lang. under resource files they give the values for the strings which they have used in webpage.
But i have dynamic data showing i gridview which is retriving from database. for this how can i change the data to another language. hundreds of records will be in there in grid and data will change frequently.
G. Satish
|
|
|
|
|
Hi! I'm bit confused about 3-tier architecture and need some advice in the right direction.
1.If I'm having a single project in which I have separate classes for Business layer and separte class for Data access layer. Is it an example of 3-tier architecture???
2. If I'm having 3 separate projects, one only involved with displaying the data and one is a web service/window app invoked through remoting and the third application working as data tier. Is it a proper example of a 3 tier architecture??
Please correct my understanding or provide a link to a good article or ebook.
Thanks in advance.
Don't Quit
|
|
|
|
|
This is a good article and should help you:
http://www.c-sharpcorner.com/UploadFile/paulabraham/Building3TierAppPA11282005053625AM/Building3TierAppPA.aspx
We are not a Code Charity
|
|
|
|
|
Hello,
When ever I call the web method I get the below web method.
Message System.Web.Services.Protocols.SoapException: commandLine=OPSTMSTK Root=ProductStock EventReport=EventReport, Exception Message=SERVERNAME.Core.Connection: Read failed from remote server for header SERVERNAME:15101
at TEST.Core.ServiceHelper.WebServiceHelper.RaiseException(String webServiceNamespace, String errorMessage, String errorNumber, String errorSource, FaultCode code)
at TEST.Core.ServiceHelper.ServiceHelper.Run(String myXmlString)
at TEST.Core.ServiceHelper.ServiceHelper.RunTESTProgram(String TESTProgram)
at WSProductInfo.ProductStock.GetStatus(String ProductId, String Site)
The code is as below:
//Error code//
Applicaion.Accept.Order wsOrderAccept = new Applicaion.Accept.Order();
wsOrderAccept.getStatus()
//Error code//
If I write the below code twice (call web method 2 times), like if failed i.e throws an exception then go to catch and try again. In this case it works, strange!
Applicaion.Accept.Order wsOrderAccept = new Applicaion.Accept.Order();
try
{
wsOrderAccept.getStatus()
}
catch
{
wsOrderAccept.getStatus()
}
Any Idea....plz suggest some thing.
Regards,
Pavas
Regards,
Pavas
|
|
|
|
|
in one usercontrol i am using modalpopup,
to validate form i am using javascript, which is written in .js file.and
included from scriptmanager in masterpage.
now when i click on button,
javascript cannot get the control or can say clientid of control(e.g. textbox)
but this problem is in firefox only,it works perfet in ie.
anybody plz fix the problem.
thanks
VISHAL PAREKH
|
|
|
|
|
javascript could be disabled in firefox, check that first then post back
We are not a Code Charity
|
|
|
|
|
no it works in firefox,when i write alert("test")
it is displayed correct,but when i write
alert(b); where b is var of javascript assign to textbox control
then it displayed null
VISHAL PAREKH
|
|
|
|
|
Hello, I am using the calendar control and i want to save the selected date into my database. The problem occurs when i am trying to save a date, and the day i pick is >=13. The database saves dd/MM/yyyy, but the calendar is sending to the database a MM/dd/yyyy. I used the toString function, and the formats available, but nothing.
Thank you, a priori.
|
|
|
|
|
Now I could be wrong here but wont the database save it i a particuler format because it is set up to do so.
If that is the case just change the format of it when you retrive it from the database.
We are not a Code Charity
|
|
|
|
|
I am displaying query results in repeater control. now i want to click any row of repeater and get id of that row. is it possible through javascript. if yes then plz help through supportive text.
Thanx a lot
|
|
|
|
|
Hi,
Let’s say you are going to click on a button placed in the repeater. And I assume that there is a field that you want to get the ID of. So here I will assume it to be ‘CustomerID’. Duing item bound this customer ID will be assigned as the CommandArgument of the button that you will be clicking.
Sample - Code
<asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
<ItemTemplate>
<br />
<asp:Label ID="lblCustomerName" Text='<%#Eval("CustomerName") %>' runat="server"
Width="100px"></asp:Label>
<asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" CommandArgument='<%#Eval("CustomerID") %>' />
</ItemTemplate>
</asp:Repeater>
In the ItemDataBound event of the Repeater, access the button, and get the commandargument, which will be the ID you want and here, I’m calling an alert to return the ID.
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Button btnEdit = (Button)e.Item.FindControl("btnEdit");
if (btnEdit != null)
{
string sId = "The selected item ID:" + btnEdit.CommandArgument.ToString();
btnEdit.Attributes.Add("onclick", "javascript:return " +
"alert('" + sId + "')");
}
}
Hope it’s clear.
Thx,
Gayani
|
|
|
|
|
Thanx Gayani Sir.
This second of my questions that u have helped me out. Thanx a ton.
|
|
|
|
|
i implimented this but there is a problem that id it gets is the id of last row only.
|
|
|
|
|
Hi,
You are most welcome.
Can u pls copy that code(.aspx and .cs files), so that I can find out where the error is.
Here is a another way of testing whether it returns ID correctly.
Just add the following code to your repeater and check.
<asp:Label ID="lblDisplayIDs" Text='<%#Eval("CustomerID") %>' runat="server"></asp:Label>
For verification.
Thx,
Gayani
modified on Friday, June 6, 2008 4:37 AM
|
|
|
|
|
Here is code given below
.aspx File:-
<table width="556px" cellpadding="0" cellspacing="0" rules="all" border="1" bordercolor="gray" >
<asp:Repeater ID="rpt_Details" runat="server" OnItemDataBound="rpt_Details_ItemDataBound">
<HeaderTemplate>
<tr>
<th align="center" width="67px">
ProductID</th>
<th align="center" width="190px">
ProductName</th>
<th align="center" width="70px">
SupplierID</th>
<th align="center" width="75px">
CategoryID</th>
<th align="center" width="127px">
QuantityPerUnit</th>
<th align="center" width="127px">
Get ID</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%#Eval("ProductID")%>
</td>
<td>
<%#Eval("ProductName")%>
</td>
<td>
<%#Eval("SupplierID")%>
</td>
<td>
<%#Eval("CategoryID")%>
</td>
<td>
<%#Eval("QuantityPerUnit")%>
</td>
<td>
<asp:Button ID="btn_GetID" runat="server" Text="GetID" CommandName="Edit" CommandArgument='<%#Eval("ProductID") %>' />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
.cs File:
protected void rpt_Details_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
Button btnedt = (Button)e.Item.FindControl("btn_GetID");
if (btnedt != null)
{
int id = Convert.ToInt32(btnedt.CommandArgument);
Label2.Text = id.ToString();
}
}
|
|
|
|