Welcome :Guest
 Sign In Register
Win Surprise Gifts!!!
Congratulations!!!

Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
 Post New Web Links

## More Related Resource Links

### Help with updating database with values from Repeater control using c#

Hello, I'm new to ASP.NET 3.5 with C#. I really need some help.

I used a Repeater control to create a simple (editable) list where, when a user logs in, they can edit their list of expenses.  The ASP page works fine.

My issue is with the code-behind.  I am really confused with how to extract the values from the repeater control. The FindControl method does not seem to be working.  Also, the code I am using resets my 'Amount' values back to 0.00. (0.00 is the amount the user sees when they first encounter the page).

Here's a portion of the code on the ASP page:

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"

onitemcommand="Repeater1_ItemCommand">

.

<ItemTemplate>

.

<td><asp:Label ID="lblExpId" runat="server"  Text='<%# Bind("ExpId") %>'></asp:Label> </td>

<td><asp:Textbox ID="lblExpense" runat="server" Width= "190px" Text='<%# Bind("ExpenseName") %>'></asp:Textbox> </td>

<td><asp:Textbox ID="txtAmount" runat="server" Width= "100px"

### How to stored values 10.57 into database

Hi,

I have the variable value 10.57
10.57 If I write, it stores data: 1057.00

I need 10.57 into database

thanks.

### Accessing a row's dropdownlist values AFTER the gridview control is in Edit mode

Hello, I have a gridview control. When it goes into Edit mode, there are 3 dropdownlists in one cell that are populated by separate stored procedures during the RowDataBound event. The 1st dropdownlist's value is used as a parameter to determine what the 2nd dropdownlist is populated with. The 2nd dropdownlist's value is used as a parameter to determine what the 3rd dropdownlist is populated with. Everything works fine when the row is first put into Edit mode. While I'm in Edit mode and I change the selection in the 1st dropdownlist, how do I access the control so I can feed this new parameter to the 2nd dropdownlist? I have the first 2 dropdownlists set for AutoPostBack so that the Page_Load event is fired when the user changes a value. I know how to get access to these controls via the FindControl method when the row is being databound but how do I find the control during the Page_Load event? Thanks for any help!!!   Penny

### Writing values back to a database

Hi All, I'm trying to write values back to an access database from an open source mathematical programming language (called glpk) using ODBC. I succeeded in doing so in most variables except one. The problem is described below: The following code gets an error when writing the data: \begin code:   table x3_iii {j in TF, k in C, p in P, t in T: x3[j,k,p,t]>0} OUT 'ODBC'   'FileDSN=.\d2.dsn'   'UPDATE ((Channels a INNER JOIN ChannelPeriodProducts b' 'ON a.ChannelID = b.ChannelID)' 'INNER JOIN TransformerTypes d' 'on a.OriginFacilityID = d.FacilityID' 'SET b.Quantity = ?'   'WHERE d.TransformerTypeID = ?'   'AND a.OriginFacilityID =?'   '    AND b.ProductID = ?'   '    AND b.PeriodID = ?':   x3[j, k, p, t], j, k, p, t; \end code Note that the sql is on multiple lines, because of a maximum strings limit in the glpk (but the way I used in the code is fine and worked without problems for writing other variables). Now, let me describe what I am basically trying to do: I'm trying to write the values for the variable x3[j,k,p,t] in its field "Quantity" in the table 'ChannelPeriodProducts'. The indices for that variable are j,k,p,t. The 'ChannelPeriodProducts' table has a "ChannelID", "PeriodID", "ProductID" and "Quantity" field

### Accessing a database

I have added a folder called "Databse" in my application and inside that i have a databse file(SQL Databse named dbFiles), and my connection string looks like this : < add name="conString" connectionString="Data Source=localhost;database=dbFiles;Persist Security Info=True;"/> Now my problem is i am unable to open a connection to this database. What am i doing wrong????

### Accessing database in STANDBY mode while log shipping

Hi, ÃÂ ÃÂ ÃÂ  I am testing with Log shipping, I have it setup and it is working just fine. The secondary database was restored with Standby mode and is readonly. I have no problem accessing and querying data from the secondary database but I noticed if changes are made to the primary and I am accessing the databaseÃÂ when the restore step to the secondary runs it fails with the following error: Message2006-07-31 09:40:54.33ÃÂ *** Error: Could not apply log backup file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\LogShip\CI_REPLICATION_TEST_20060731131501.trn' to secondary database 'CI_REPLICATION_TEST'.(Microsoft.SqlServer.Management.LogShipping) ***2006-07-31 09:40:54.33ÃÂ *** Error: Exclusive access could not be obtained because the database is in use.RESTORE LOG is terminating abnormally.(.Net SqlClient Data Provider) *** This appears to be because you can not restore to a database that is in use? How do you get around this? Is it possible? How do I query data from the secondary db without worrying about causing log shipping to fail? Do I not worry about it because at somepoint when Exclusive access isÃÂ obtainable all the logs will be rolled forward, but this couldÃÂ create a wide gap in sychronization between the primary and secondary db's, say if someone or somethingÃÂ does not properly log off. I guess I could disconnect all users prior to applying tlogs but that kind

### Save temporary values in gridview to database

Hi.I have a code here,where it will store temporary data in a gridview from textbox where when the data is stored temporarily in gridview.Alternately,it will be linked to search the word in google.Now i want to save the values in the gridview to database.I m new to asp.net,seeking ideas from all.Any ideas guys?Here is my .aspx code: <body> <div> <table > <tr> <td class="style1"> <asp:Label ID="Label1" runat="server" Text="Caller Info :"></asp:Label> </td> <td style="width: 100px"> <asp:TextBox ID="TxtName" runat="server" class="cls" onekeypress="" ToolTip="Press Enter key for new input"></asp:TextBox> </td> </tr> </table> <asp:Button ID="BtnAddToTable" runat="server" align="right" class="cls" Text="Add" OnClick="BtnAddToTable_Click" /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" > <Columns> <asp:TemplateField HeaderText="Caller Information"> <ItemTemplate> <a onclick='document.getElementById("<%=iframe1.ClientID%>").src = this.href; return false