Get A Variable From Db When A FormView Loads

Apr 21, 2006

Hello,
I have a formview and when I load it I would like to check a variable "Cover" from the database, to see wether or not it is empty.

But how on earth do I get the variables from the sqldatasource in my function "FormView1_load(...)" ??

View 1 Replies


ADVERTISEMENT

SQL 7 Loads / MTS Use

Feb 24, 1999

I am at turning point with MS and SQLv6.5. I really need to make a decision for a large scale growth of a project. I was hoping people could respond for their experiences with SQL 7, with some rough load numbers ( concurrent connections, size DB, transactions/sec or day). Also is anyone using this product with MTS.

Production numbers only please. So many people have worked with the Beta and are doing testing, but it doesn't really count until it is in production.

thanks in advance.

View 3 Replies View Related

Bulk Loads Using OLE DB

Feb 28, 2008

Basicallly, I have two questions-

Is it requirement that the OLE DB provider should have implemented IRowetChange interface so that it can be used to configure OLE DB destination?

Is there any way to configure a destnation for bulk and faster load? Normal OLE DB destination via IRowsetChange does load one row at a time ( InsertRow() ).

Thanks,
Vivek.

View 1 Replies View Related

VS IDE Loads All Packages During Run

Jul 31, 2006

I recently got a new computer and reinstalled Visual Studio 2005, SQL, and all the goodies. When I build a SSIS project with multiple packages and run it, VS loads all of the packages in the project into the IDE before execution. None of the packages are related and I only want the current package to be loaded. I don't remember it working this way before. I've looked through the package, project, solution, and VS options and can't find anything that might control this behavior.

Does anyone know what controls this behavior?

View 1 Replies View Related

Database Loads Very Slow

Aug 23, 2000

I have a database that's 2.5GB but only has about 17MB of actual data. I've setup a standby server that I load my dumps into. The load takes about 10 miuntes. The dump takes about a minute and a half (which also seems slow to me for that small amount of data). I don't expect that it should take that long to load 8800 pages into a database. The standby server is the same hardware as the production server (sinlge 500MHz Xeon, 2GB RAM, RAID 5). The server has only a single RAID 5 array to store all the OS, and all the SQL data however, I still don't thinkit should take thta long to load. Let me know what you think.


--Buddy

View 1 Replies View Related

ASP + SQL Loads Really Slow Over Intranet

Jul 23, 2005

Hi guys,I've created a web application using ASP together with SQL Server asour db source, running through IIS 6 on a Winows Server 2003 platform.This application retrieves a list of customer codes from our db, sorecords returned could be as many as 2000+ for any single transaction.The application runs fine for users from the same state. However, ourinterstate colleagues have notice that it takes more than 3-4mins forthe page to load, while it only takes me < 2secs to load.Our intranet server is located in the same state as I, so anyone fromwithin this state has no problems loading the page. All other statesare finding it unbearable.I've done some debugging, and it appears to be a server factor.I saved the page with the longest list to a local drive and opened itlocally in IE and it loads quickly.Does anyone have any suggestions as to how to speed this application upfor our interstate users?Any ideas would appreciated.Thanks,Shawn

View 3 Replies View Related

Paralellizing File Loads

Jul 19, 2007

I have a package that reads a table that has a list of files that I need to load into a table that arrive every night. These files range from 50mb to 1.5gb, The entire process to load and transform is taking about 50mins, which is about a 300% increase from our current production environment. However I am looking at ways to improve performance by loading all of the data into the staging table at the same time.







Is this possible, and do you guys think it would improve performance significantly?



View 5 Replies View Related

SQL Server Loads Over Network Take Forever

Feb 16, 1999

When I attempt to load a database from dump format across a network (100mb Ethernet) It takes forever. (15 hours for 16GB!) can anyone help me find a starting point to troubleshoot this?

Thanks!

-Chris

P.S. File Copies of the same size move at a rapid fashion, and I cannot find any bottlenecks in the network.

View 2 Replies View Related

DTS Loads Text File In Wrong Sequence

Apr 27, 2005

I am trying to load a text file into a temporary table in MS-SQL using DTS.

The file is coming from a unix machine and contains comma-delimited entries.

the DTS script runs every minute and the transformation maps values in the text file into corresponding columns in the temp table.

The problem is that the sequence of the entries in the text file does not match the sequence of the values imported.

I have several instances of this script (all identical) but only one file seems to be out of whack. Does anyone know what could be causing this? This is for a real-time trading system so the sequence has to be perfect.

Thanks
Alastair

View 8 Replies View Related

Large Table Loads && Transaction Log Issues

Apr 7, 2004

I have a table that’s about 3 gigs, using this table and a few others I’m making another table. The problem is when making the new table my transaction log inflates so much that I’m running out of disk space. What I can I do to prevent this or to keep the transaction log size under control?

View 4 Replies View Related

SQL 2012 :: Availability Groups And Bulk Loads

Sep 8, 2015

We have some tables that are bulk-loaded every day and they do not have RI to the other tables in the database.

To ease pressure on the logs, I had the idea of spinning them off to another database on the same AG in simple or bulk-load recovery model and using synonyms to point to them so the code base would not need changing.

I know an earlier bug in 2005 existed that basically made the query analyzer ignore indexes if a table was accessed via a synonym.

View 0 Replies View Related

SQL 2012 :: SSIS MERGE For Incremental Loads

Sep 28, 2015

I inherited an SSIS package that is rather simple. It grabs data from a SQL Query and then loads it into a SQL table. The first step of this process TRUNCATES the destination table and then reloads for the current year. This table has over a million rows and the DB SOURCE that we are pulling from is not in our domain, so one can imagine how long this takes.

This process is working fine, (given the 45 minutes it takes to repopulate data in the DESTINATION table), but what I really need is a way to load only the rows that are NEW and UPDATED. I would also need functionality to DELETE the rows that have been removed (sounds like a MERGE, right?).I tried using MERGE and MERGE JOIN transformations but these transformations seem to be different from the T-SQL MERGE statement. MERGE seems like a slow UNION and MERGE JOIN only seems to work with SELECTS.

View 3 Replies View Related

Sql Server 2005 Loads Data Slowly

Oct 1, 2007

This is the code i use.

Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset



Private Sub Form_Load()


Set cnn = New ADODB.Connection
cnn.ConnectionString = "driver={SQL Server};" & "server=SCHS-SQL;uid=sa;pwd=sa;database=Library"
cnn.Open

Call loadrst

End Sub

Public Sub loadrst()
Set rst = New ADODB.Recordset
Dim sql1 As String
sql1 = "select * from Books order by srno"
rst.Open sql1, cnn, adOpenDynamic, adLockOptimistic, adCmdText

If rst.EOF = True Then
MsgBox ("No records are present")
Command1.Enabled = False
Else
Call display
Command1.Enabled = True
End If


End Sub



This is the code i use basically to connect my vb6 application to sql server 2005. I had started out lately trying to use sql server instead of access. So far none of the program have given any problems as the databases has a max one of 120 records. But the one which this code connects to has about 5200 records. I had imported the tables from access into sql server. The size of the database was around 17.67mb so i shrank it and it became 4mb. But still it takes roughly 2 minutes for the user to see the records in the grid. Could you tell me what to do?

Sheldon

View 3 Replies View Related

I Have A Flat File With 500.000 Rows But It Only Loads 249999

Nov 27, 2007

Hi,

In a dataflow there is a Flat File Source that loads a file with 500000 rows but when I execute the package it only loads 249999, I have verified the file and every looks fine, it is a csv and ms-excel recognized it perfectly.

I'm wondering if there is any technical limitation regarding to the amount of rows per file?

and what else can I verify for discover the problem?

thanks

View 7 Replies View Related

Enterprise Manager For 2000 No Longer Loads

Nov 8, 2007

After installing DTS designer tools for SSIS/Visual studio,
I can no longer open enterprise manager and get the following error:

mmc.exe - entry point not found

The procedure entry poinst ?ProcessExecute@@YAXPAUXHWND_@@PBG1@Z could not be located in the dynamic link library SEMSFC.dll.

View 4 Replies View Related

DB Engine :: How To Release TempDB Space After Data / Batch Loads

Apr 22, 2015

I have scenario where I have process that loades data into SQL server 2012 database by doing some manipulation on data like sorting , aggregation, etc. Once this process is completed it's not free up the Tempdb space.  If I restart the database, then it does.

is there any way (apart from shirking) to release space for Tempdb, like writing some post SQL queries to delete/ truncate the data and logs from temp db?

View 8 Replies View Related

SQL Server 2008 :: Partition Sliding Window Causing Loads Of Blocks

Oct 29, 2015

We have a massive database with an almost massive amount of traffic to and from it.

I've been requested to implement a sliding window partitioning with 2 partitions an active and passive 1,I managed to test this on a very small testbed last month.

I currently moved 97k table on to the partition function leaving me another 26 k to go

I'm using the following stored procedure to implement the sliding window

CREATE PROCEDURE [dbo].[ManageFactSlidingWindow](@pFunction nvarchar(max),@pSchema nvarchar(max),@FG nvarchar(max),@moveDays int)
/*****************************************************************************
PROCEDURE NAME: [ManageFactSlidingWindow]
AUTHOR: Arshad Ali
CREATED: 02/24/2013
DESCRIPTION: This stored procedure manages sliding window for the partitioned table

VERSION HISTORY:
DATE EMAIL Company DESCRIPTION

[Code] .....

When I try to move the partition even a single day I get loads of locks.

View 0 Replies View Related

FormView DefaultMode

Nov 29, 2006

HiI'm using SQLDataSource declarative data access with stored procedures (Select, Insert, Update, Delete).  I need to display ReadOnly, Insert or Edit FormView DefaultMode from my FormView depending on whether or not the authenticated UserId is present in the Select stored procedure reference table. 
The scenario - during registration the new registrant may or may not complete a data entry step.  If not that user must enter data on the given form before other site related functions can be accessed.  Additionally, once these values are entered they may need to be changed.
Any ideas?Thanks a lot.John
 

View 2 Replies View Related

Can You Have A FormView Use SELECT FROM WHERE IN?

Mar 4, 2007

 How can I generate the following command with VB Code Behind in NET 2.0 and have a FormView access the command.
The 4 and 20 below may be 3 and 100 and etc."SELECT * FROM [Solution] WHERE ([SolutionID] IN ('4', '20'))" The List is generated by two multiselect controls (ListBox and CheckBoxList) and a text box used to search a description field in VB code behind (ASPX.VB) This post is a summary of a previous post not responded to. Sincerely,Unhistoric 

View 2 Replies View Related

FormView Problem! PLease Help!

Jun 14, 2008

Hello all!
 I am kinda new to this ASP.NET world! I have a website that requires daily updates! initially i was updating my database (MSSQL) manually, but now after watching videos from viseo section of this site i thought it would be better if i use formview to update , delete or edit my data! It all worked fine for me on my local machine! but when i deployed it on my server. I was able to add new records but when i tried to update an existing record or delete some record i got this error message...
 
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.
 
This is my coding
 
<form id="form1" runat="server">    <div style="text-align: center">        <div style="text-align: center">            <table>                <tr>                    <td style="width: 100px">                        <asp:FormView ID="FormView1" runat="server" AllowPaging="True" CellPadding="4" DataKeyNames="id"                            DataSourceID="SqlDataSource1" ForeColor="#333333" Height="290px" Width="329px">                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />                            <EditRowStyle BackColor="#999999" />                            <EditItemTemplate>                                id:                                <asp:Label ID="idLabel1" runat="server" Text='<%# Eval("id") %>'></asp:Label><br />                                title:                                <asp:TextBox ID="titleTextBox" runat="server" Text='<%# Bind("title") %>'>                                </asp:TextBox><br />                                url:                                <asp:TextBox ID="urlTextBox" runat="server" Text='<%# Bind("url") %>'>                                </asp:TextBox><br />                                <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"                                    Text="Update">                                </asp:LinkButton>                                <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"                                    Text="Cancel">                                </asp:LinkButton>                            </EditItemTemplate>                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />                            <InsertItemTemplate>                                <asp:TextBox ID="idTextBox" runat="server" Text='<%# Bind("id") %>'></asp:TextBox><br />                                title:                                <asp:TextBox ID="titleTextBox" runat="server" Text='<%# Bind("title") %>'></asp:TextBox><br />                                url:                                <asp:TextBox ID="urlTextBox" runat="server" Text='<%# Bind("url") %>'></asp:TextBox><br />                                <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"                                    Text="Insert"></asp:LinkButton>                                <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"                                    Text="Cancel"></asp:LinkButton>                            </InsertItemTemplate>                            <ItemTemplate>                                <span style="font-size: 24pt">id: </span>                                <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' Width="119px"></asp:Label><br />                                <span style="font-size: 24pt">title: </span>                                <asp:Label ID="titleLabel" runat="server" Text='<%# Bind("title") %>' Width="111px"></asp:Label><br />                                <span style="font-size: 24pt">url: </span>                                <asp:Label ID="urlLabel" runat="server" Text='<%# Bind("url") %>' Width="105px"></asp:Label><br />                                <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"                                    Text="Edit"></asp:LinkButton><span style="font-size: 24pt"> </span>                                <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"                                    Text="Delete"></asp:LinkButton><span style="font-size: 24pt"> </span>                                <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"                                    Text="New"></asp:LinkButton><span style="font-size: 24pt"> </span>                            </ItemTemplate>                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />                        </asp:FormView>                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues"                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [homelinks] WHERE [id] = @original_id AND [title] = @original_title AND [url] = @original_url"                            InsertCommand="INSERT INTO [homelinks] ([id], [title], [url]) VALUES (@id, @title, @url)"                            OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [homelinks] ORDER BY [id] DESC"                            UpdateCommand="UPDATE [homelinks] SET [title] = @title, [url] = @url WHERE [id] = @original_id AND [title] = @original_title AND [url] = @original_url">                            <DeleteParameters>                                <asp:Parameter Name="original_id" Type="Int32" />                                <asp:Parameter Name="original_title" Type="String" />                                <asp:Parameter Name="original_url" Type="String" />                            </DeleteParameters>                            <UpdateParameters>                                <asp:Parameter Name="title" Type="String" />                                <asp:Parameter Name="url" Type="String" />                                <asp:Parameter Name="original_id" Type="Int32" />                                <asp:Parameter Name="original_title" Type="String" />                                <asp:Parameter Name="original_url" Type="String" />                            </UpdateParameters>                            <InsertParameters>                                <asp:Parameter Name="id" Type="Int32" />                                <asp:Parameter Name="title" Type="String" />                                <asp:Parameter Name="url" Type="String" />                            </InsertParameters>                        </asp:SqlDataSource>                    </td>                </tr>                <tr>                    <td style="width: 100px">                    </td>                </tr>                <tr>                    <td style="width: 100px">                    </td>                </tr>            </table>        </div>        </div>    </form>
 
 
Please i know this problem is perhaps because of a very little mistake i may have done but i am going nuts because of it! please tell me what i have done wrong!
 
 

View 2 Replies View Related

Table Loads From DB2 - Parallel Processes, Linked Server, And Lightweight Pooling Issue

Aug 17, 2007

Hello. I have a 32-bit SQL 2005 (SP1) server that is my current Production server. I also have a 64-bit SQL 2005 (SP1) server that will become my Production server. I have several SSIS packages that load/refresh data on a nightly basis to a few of my databases from DB2 (MVS). I have the packages setup on the current Production server (32-bit) and all is working well through the Microsoft OLE DB provider for DB2. However, on the 64-bit server, I am experiencing some issues with the SSIS packages failing due to large loads. Loads that are loading tables with 500K, or less, data seem to run without issue (through SQL Agent Jobs). But, larger table loads are failing.

I do have a linked server set up on the 64-bit server to the 32-bit server, for other processes. And because of this I have lightweight pooling turned off on the 64-bit server (because of distributed querying). Lightweight pooling is turned on on the 32-bit server. Could this be what is causing some of my issue? Since I don't have the lightweight pooling option turned on (on the 64-bit server), am I not getting the proper amount of through-put for my 8 dual core CPU server?

Thanks
Scottye

View 1 Replies View Related

MSDE [SQL 2000] -- Server Balks When Web Page Loads -- Select Permission Denied

Oct 28, 2006

Hi folks,

I'm having trouble getting off the ground with the Web application walkthrough "Walkthrough: Creating a Web Application Using Visual C# or Visual Basic" in VS.NET Pro 2002 [Academic] documentation. After a bit of fishing around, and consulting the MS Knowledge Base, I got the pubs database installed. I also got the connection to work well enough that the dataset would fill in the IDE.

The problem is that when I try to run the web form, either from the IDE debug menu, or by accessing the .aspx file on localhost using Firefox, I get the error:
SELECT permission denied on object 'titles', database 'pubs', owner 'dbo'.
showing in the browser.
My understanding is that this page is running as ASPNET, and I did already carry out the recommended commands to enable access:
C:>osql -E -S MY-MACHINE-NAMEVSDOTNET -Q "sp_grantlogin 'MY-MACHINE-NAMEASPNET'"
C:>osql -E -S MY-MACHINE-NAMEVSDOTNET -d Pubs -Q "sp_grantdbaccess 'MY-MACHINE-NAMEASPNET'"
both of which commands returned successfully. Any suggestions as to what else I should do to get the necessary permissions to actually display the data in my browser? Does the IIS user account need permission also?

Thanks for any insight into this vexing problem. I must say that along the way, I have had some fun exploring the osql comand-line tool. Using the -E switch, I have been able to run select and upgrade queries, but this is all pretty much fishing in the dark. I would like to get back to actually working with the walthroughs in the Visual Studio documentation.

Thanks,

Joseph

View 4 Replies View Related

Formview Insertion And PostBackUrl

Sep 13, 2006

I am working in ASP.Net2.0 and Sql server 2005.Using asp button(FormView) I am trying to insert the data from the form into the database and at the same time want to move on to another page indicating the succes of insertion.My code: <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"Text="Submit" PostBackUrl="~/ClinicDownload.aspx"></asp:Button> It is moving on to another page, but no insertion is taking place. If I don't give the PostBackUrl then I can insert. I want to do both in one click....Hope someone can help me. Regardspreeshma 

View 1 Replies View Related

Formview Doesn't Update

Dec 13, 2006

I have formview and I have a SqlDatasource for it.I have few textboxes in the edit mode and bind it to the data columns or fields in the database.If the data for all those fields have content in it, then it will update just fine. However, if one of the text field is null or empty, the formview can't be updated    When i try to update with empty data in one textboxData field allows null value, and type are varchar.I am suspecting it's throwing an internal exception somewhere. However, since all the operations are handled by the asp.net.  I have no idea what's going on internally. Does anyone have an idea what's causing this error and how to fix it?  

View 2 Replies View Related

How Get The New Recorde ID After Formview Insert

Mar 19, 2007

I have formview and want to get uniq id from SQL Server 2005 after it inserted.
I think i should put some code in the event of oniteminserted, anybody have sample code
Thanks
Hu 

View 1 Replies View Related

Update From A FormView To An Oracle DB

Jul 23, 2007

Hi, I followed a msdn2 tutorial http://msdn2.microsoft.com/fr-fr/library/system.web.ui.webcontrols.formview(VS.80).aspx using a formview.I got one error when trying to update a field : System.Data.OracleClient.OracleException: ORA-01036: illegal variable name/numberHere is my DataBase definition :ColumnType  Nullable Primary Key
EMPLOYEE_IDNUMBER(6,0) No - 1
FIRST_NAMEVARCHAR2(20) Yes - -
LAST_NAMEVARCHAR2(25) No - -If someone has already got this error before or see why it happen, i'll be very happy if he tell it to me why.    Here is my aspx page code : <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Titre Forview</title></head> <body> <form id="Form1" runat="server"> <h3>FormView Example</h3> <asp:FormView id="EmployeeFormView"
datasourceid="EmployeeSource"
allowpaging="false"
datakeynames="Employee_ID"
headertext="Employee Record"
emptydatatext="No employees found."
onitemupdating="EmployeeFormView_ItemUpdating"
onmodechanging="EmployeeFormView_ModeChanging" runat="server"> <headerstyle backcolor="CornFlowerBlue"
forecolor="White"
font-size="14"
horizontalalign="Center" wrap="false"/> <rowstyle backcolor="LightBlue"
wrap="false"/> <pagerstyle backcolor="CornFlowerBlue"/> <itemtemplate> <table> <tr><td rowspan="6"></td> <td colspan="2"></td> </tr> <tr><td><b>Name:</b></td> <td><%# Eval("First_Name") %> <%# Eval("Last_Name") %></td> </tr> <tr><td><b>Employee_ID:</b></td> <td><%# Eval("Employee_ID") %></td> </tr> <tr><td><b>Hire Date:</b></td> <td><%# Eval("Hire_Date","{0:d}") %></td> </tr> <tr><td></td><td></td></tr> <tr><td colspan="2"> <asp:linkbutton id="Edit"
text="Edit"
commandname="Edit"
runat="server"/></td> </tr> </table> </itemtemplate> <edititemtemplate> <table> <tr><td rowspan="6"></td> <td colspan="2"></td> </tr> <tr><td><b>Name:</b></td> <td><asp:textbox id="FirstNameUpdateTextBox"
text='<%# Bind("First_Name") %>'
runat="server"/> <asp:textbox id="LastNameUpdateTextBox"
text='<%# Bind("Last_Name") %>'
runat="server"/></td> </tr> <tr><td></td><td></td></tr> <tr><td><b>Hire Date:</b></td><td> <asp:textbox id="HireDateUpdateTextBox"
text='<%# Bind("Hire_Date", "{0:d}") %>'
runat="server"/> </td> </tr> <tr valign="top"><td></td><td></td></tr> <tr> <td colspan="2"> <asp:linkbutton id="UpdateButton"
text="UPDATE"
commandname="Update"
runat="server"/> <asp:linkbutton id="CancelButton"
text="Cancel"
commandname="Cancel"
runat="server"/> </td> </tr> </table> </edititemtemplate> </asp:FormView> <asp:label id="MessageLabel"
forecolor="Red"
runat="server"/> <asp:sqldatasource id="EmployeeSource"
selectcommand="Select Employee_ID, Last_Name, First_Name, Hire_Date From Employees where EMPLOYEE_ID=99"
updatecommand="update EMPLOYEES set LAST_NAME='Last_Name', FIRST_NAME='First_Name' where EMPLOYEE_ID=99"
ConnectionString="<%$ ConnectionStrings:ConnectionStringOracle %>"
ProviderName="<%$ ConnectionStrings:ConnectionStringOracle.ProviderName %>" runat="server"/> </form> </body></html>  And my aspx.cs page code : using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using System.Collections.Specialized;using System.Data.OracleClient;using System.Windows.Forms;public partial class A_Supprimer_Aussi : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } public void EmployeeFormView_ItemUpdating(Object sender, FormViewUpdateEventArgs e) { // Validate the field values entered by the user. This // example determines whether the user left any fields // empty. Use the NewValues property to access the new // values entered by the user.
ArrayList emptyFieldList = ValidateFields(e.NewValues);

if (emptyFieldList.Count > 0) { // The user left some fields empty. Display an error message. // Use the Keys property to retrieve the key field value.
String keyValue = e.Keys["EmployeeID"].ToString(); MessageLabel.Text = "You must enter a value for each field of record " + keyValue + ".<br/>The following fields are missing:<br/><br/>"; // Display the missing fields.
foreach (String value in emptyFieldList) { // Use the OldValues property to access the original value // of a field.
MessageLabel.Text += value + " - Original Value = " + e.OldValues[value].ToString() + "&lt;br>"; } // Cancel the update operation.
e.Cancel = true; } else
{
// The field values passed validation. Clear the // error message label.
MessageLabel.Text = ""; } } ArrayList ValidateFields(IOrderedDictionary list) { // Create an ArrayList object to store the // names of any empty fields.
ArrayList emptyFieldList = new ArrayList(); // Iterate though the field values entered by // the user and check for an empty field. Empty // fields contain a null value.
foreach (DictionaryEntry entry in list) { if (entry.Value == String.Empty) { // Add the field name to the ArrayList object.
emptyFieldList.Add(entry.Key.ToString());
}
}

return emptyFieldList; } public void EmployeeFormView_ModeChanging(Object sender, FormViewModeEventArgs e) { if (e.CancelingEdit) { // The user canceled the update operation. // Clear the error message label.
MessageLabel.Text = ""; } }}   

View 1 Replies View Related

FormView Insert Query

Apr 22, 2008

Hello,I am trying to determine the best way to do the following.  For simplicity we have two tables Master and Awards.  These share a common pk UFID.  Master contains columns (UFID, AccountName...) Awards contains columns (ID, UFID, AwardingAgency, Amount)  When a user submits a new award in Formview I would like  to populate the UFID automatically so that the user does not have to enter this each time.   I am currently using the logged in username to select records for that user only.  The value of this username matches Master.AccountName.  Since I am hoping to use this same logic across many tables, I would appreciate any suggestions as to how best handle this.Thanks,Ken 

View 1 Replies View Related

Formview Does Not Update Database

May 21, 2006

HiI'm using a FormView to allow my administrator to add/edit/remove questions/answers to the FAQ of my helpdesk.Now I figured out how to use the FormView to adjust the data, the only thing the FormView does NOT do, is actually update the database, it does not give any errors, it just doesn't do anything.This is the code:  <asp:SqlDataSource ID="sdsAdminFaqDetails" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>"
DeleteCommand="DELETE FROM [Faq] WHERE [QuestionID] = @QuestionID"
InsertCommand="INSERT INTO [Faq] ([Question], [Answer]) VALUES (@Question, @Answer)"
SelectCommand="SELECT * FROM [Faq]"
UpdateCommand="UPDATE [Faq] SET [Question] = @Question, [Answer] = @Answer WHERE [QuestionID] = @QuestionID">
<DeleteParameters>
<asp:Parameter Name="QuestionID" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Question" />
<asp:Parameter Name="Answer" />
<asp:Parameter Name="QuestionID" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="Question" />
<asp:Parameter Name="Answer" />
</InsertParameters>
</asp:SqlDataSource>
<asp:FormView ID="FormView1" runat="server" DataSourceID="sdsAdminFaqDetails">
<ItemTemplate>
<table border="0">
<tr>
<td style="width: 189px"><asp:Label ID="lblQuestionLabel" runat="server" Text="Vraag:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px"><asp:TextBox ReadOnly="True" ID="txtQuestion" runat="server" Text='<%# Eval("Question") %>' Width="309px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 189px"><asp:Label ID="lblAnswerLabel" runat="server" Text="Antwoord:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px; height: 40px"><asp:TextBox ReadOnly="True" ID="txtAnswer" runat="server" Text='<%# Eval("Answer") %>' Height="160px" TextMode="MultiLine" Width="457px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Button ID="btnEdit" runat="server" Text="Wijzig" CommandName="Edit" /> <asp:Button ID="btnInsert" runat="server" Text="Nieuw" CommandName="New" /></td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table border="0">
<tr>
<td style="width: 189px"><asp:Label ID="lblQuestionLabel" runat="server" Text="Vraag:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px"><asp:TextBox ID="txtQuestion" runat="server" Text='<%# Bind("Question") %>' Width="309px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 189px"><asp:Label ID="lblAnswerLabel" runat="server" Text="Antwoord:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px; height: 40px"><asp:TextBox ID="txtAnswer" runat="server" Text='<%# Bind("Answer") %>' Height="160px" TextMode="MultiLine" Width="457px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Button ID="btnUpdate" runat="server" Text="Bevestig" CommandName="Update" /> <asp:Button ID="btnDelete" runat="server" Text="Verwijder" CommandName="Delete" /></td>
</tr>
</table>
</EditItemTemplate>
<InsertItemTemplate>
<table border="0">
<tr>
<td style="width: 189px"><asp:Label ID="lblQuestionLabel" runat="server" Text="Vraag:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px"><asp:TextBox ID="txtQuestion" runat="server" Width="309px"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 189px"><asp:Label ID="lblAnswerLabel" runat="server" Text="Antwoord:"></asp:Label></td>
</tr>
<tr>
<td style="width: 189px; height: 40px"><asp:TextBox ID="txtAnswer" runat="server" Height="160px" TextMode="MultiLine" Width="457px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Button ID="btnInsert" runat="server" Text="Voeg toe" CommandName="Insert" /> <asp:Button ID="btnCancel" runat="server" Text="Annuleer" CommandName="Cancel" /></td>
</tr>
</table>
</InsertItemTemplate>
<EmptyDataTemplate>
U hebt niet geselecteerd welke vraag u wilt wijzigen.
</EmptyDataTemplate>
</asp:FormView>
hope one of you sees where i made a mistake, or forgot about something...thx for your help

View 12 Replies View Related

Server Timeout Accessing A Formview

Jul 10, 2006

I've built a custom web-based CRM in ASP.NET 2.0 on Sql Server 2000. 
Currently updating a contact is very inconsistent. If I go into a contact through http://MyServer/secure/allcontacts.aspx or http://MyServer/secure/allcontacts.aspx?contactid=6151 then the updatecontact() sub that I have defined runs fine.
UpdateContact() consists of a sql server transaction with a try/catch block and parameters for each field on the page.
If I go through http://MyServer/secure/allcontacts.aspx?contactid=6151&Dup=true then I get
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding,"
on the catch section but no error message is rendered to the user - they see nothing at all. This seems to be happening when the application tries to access a formview control (which may or may not be visible at the time).
I've tried Data.SqlClient.SqlConnection.ClearAllPools(), myCommand.CommandTimeout = 3000, and <httpRuntime executionTimeout="180"/> in the web.config but none of these seems to be working.
The formview has a sql datasource and it gets as far as running the sqldatasource_selecting event and then gets stuck.
Can anyone help me figure out why this is happening and how I can fix it?
Thanks in advance.

View 4 Replies View Related

Sqldatasource And Formview Insert Problem

Aug 10, 2006

I m trying to INSERT a record to my Consultants table using sqldatasource and formview:
here is my sqldatasource code:
<asp:SqlDataSource ID="sqlDS1" runat="server" ConnectionString="<%$ ConnectionStrings:myDB %>"InsertCommand="INSERT INTO [Consultants] ([firstName],[lastName],[skillCategoryID],[resourceManagerID],[AMgroupID],[skillSet],[statusID],[location],[comments],[profile],[isAvailable],[dateModified],[focusID])
VALUES (@FNAME, @LASTNAME, 1, @RESOURCEMANAGERID, @AMGROUPID, @SKILLSET, @STATUSID, @LOCATION,@COMMENTS,@PROFILE,@ISAVAILABLE,getdate(),1)">

<InsertParameters>      <asp:FormParameter FormField="txtFName" Name="FNAME" />     <%--other parameters--%></InsertParameters></asp:SqlDataSource>
now in my formview i have this:<asp:FormView DefaultMode="Insert" ID="FormView1" runat="server" DataSourceID="sqlDS1" DataKeyNames="id">
<table border="0" cellspacing="5" cellpadding="0"><tr>  <td class="blacktextbold">First Name:</td>  <td class="blacktext"><asp:TextBox ID="txtFName" CssClass="txtfield" Width="200" runat="server" Text="<% #Bind('firstName')%>" /> <asp:RequiredFieldValidator ControlToValidate="txtFName" runat="server" ValidationGroup="gpInsert" ErrorMessage="Required Field" Display="Dynamic" CssClass="redtextsmallbold" /> </td></tr> </table>
THE PROBLEM:no matter what i put the txtFName field its ALWAYS null and i get INSERT error as column firstName cant accept NULLany ideas? ur help would be appreciated
 

View 4 Replies View Related

Need Help With Update Link In FormView - URGENT

Dec 7, 2006

Hi Folks,
 Somehow i am stuck at a very basic step. I have two pages  -
1. DomainList.aspx which just displays all the records from the Domains table.2. DomainAddEdit.aspx which displays the selected record in FormView(Edit Mode) with two link for Update and Cancel.
The Update link in the FormView does nothing on the first click. It just reloads the page with the new data I entered. If I click again on the Update link, it throws me an error:
"Cannot insert the value NULL into column 'DNS', table 'MSInteractive.dbo.Domains'; column does not allow nulls. UPDATE fails.The statement has been terminated. "
I have no clue why all this is happening. I have spent more than two days on this and this is very very frustrating.
Just to mention, I haven't written any code for this. Its developed all using the VWD tools available. I have posted this message earlier but haven't got any response. I am sure most of you guys must have been doing these steps everyday. So, please post your thoughts.
 Thanks a million.
Here is the relevant code for my DomainADDEdit.aspx:
<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" DefaultMode="Edit">        <EditItemTemplate>            Id:            <asp:TextBox ID="IdTextBox" runat="server" Text='<%# Bind("Id") %>'></asp:TextBox><br />            RegistrarAccountId:            <asp:TextBox ID="RegistrarAccountIdTextBox" runat="server" Text='<%# Bind("RegistrarAccountId") %>'></asp:TextBox><br />            Registrar:            <asp:TextBox ID="RegistrarTextBox" runat="server" Text='<%# Bind("Registrar") %>'></asp:TextBox><br />            DNS:            <asp:TextBox ID="DNSTextBox" runat="server" AutoPostBack="True" OnTextChanged="DNSTextBox_TextChanged"                Text='<%# Bind("DNS") %>'></asp:TextBox><br />            EmailHost:            <asp:TextBox ID="EmailHostTextBox" runat="server" Text='<%# Bind("EmailHost") %>'></asp:TextBox><br />            Registered:            <asp:TextBox ID="RegisteredTextBox" runat="server" Text='<%# Bind("Registered") %>'></asp:TextBox><br />            Expires:            <asp:TextBox ID="ExpiresTextBox" runat="server" Text='<%# Bind("Expires") %>'></asp:TextBox><br />            MsiResponsible:            <asp:CheckBox ID="MsiResponsibleCheckBox" runat="server" Checked='<%# Bind("MsiResponsible") %>' />    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MSInteractiveConnectionString %>"        SelectCommand="SELECT [Id], [RegistrarAccountId], [Registrar], [DNS], [EmailHost], [Registered], [Expires], [MsiResponsible] FROM [Domains] WHERE ([Id] = @Id)"        UpdateCommand="UPDATE Domains SET DNS = @txtDNS WHERE (Id = @Id)">        <UpdateParameters>            <asp:FormParameter FormField="DNSTextBox" Name="txtDNS" />            <asp:QueryStringParameter Name="Id" QueryStringField="Id" />        </UpdateParameters>        <SelectParameters>            <asp:QueryStringParameter Name="Id" QueryStringField="Id" Type="String" />        </SelectParameters>    </asp:SqlDataSource><br />            <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update"                Text="Update" OnClick="UpdateButton_Click"></asp:LinkButton>            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"                Text="Cancel"></asp:LinkButton>        </EditItemTemplate>
 

View 5 Replies View Related

FormView W/SqlDataSource - Auto Disposed?

Mar 17, 2007

Hi everyone,  I'm in a scenario where I am using a FormView control to edit records.  The data access is being done with an associated SqlDataSource control.
The pipeline I use is usually setup using this pattern:
(1) SqlDataSource.OnInserting -> (2) SqlDataSource.OnInserted -> (3) FormView.OnItemInserted
The SqlDataSource events expose a SqlDataSourceCommandEventArg parameter that is much like a DbCommand object where you can start a transaction and associate other command objects with the command flowing through the pipeline.
 My question is does asp.net automatically dispose of the SqlDataSourceCommandEventArg command or must I do it manually?  I assumed that after the SqlDataSource.OnInserted  event the object would be disposed.  If anyone has articles on this or any insight would be appreciated.
Thanks

View 3 Replies View Related

Dynamically Add Update Parameter To Formview

May 3, 2007

I have a formview with name, email, and password.  I bind all fields to sql except the password which is blank.
In my sqldatasource, I define parameters for name, email and id:
UpdateCommand="UPDATE UserProfile SET Name = @Name,Email = @Email WHERE (ID = @ID)"><UpdateParameters><asp:Parameter Name="Name" /><asp:Parameter Name="Email" /><asp:Parameter Name="ID" /></UpdateParameters>
In code I want to add a password parameter if there is value in the password field otherwise I don't want the password field updated.  If I add define a password parameter like above then if a user left the password field blank then their new is blank.  That's way I think adding it dynamically is the way.  But I am having problems with the code to add the parameter in sqldatasource_updating event.
Protected Sub SqlProfile_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SqlProfile.UpdatingDim password As TextBox = FormView1.FindControl Protected Sub SqlProfile_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles SqlProfile.Updating
Dim password As TextBox = FormView1.FindControl("tb_password1")
If Not password.Text.ToString & "" = "" Then
SqlProfile.UpdateParameters.Add(New Parameter("@Password", TypeCode.String, password.Text.ToString))
End If

End Sub Thanks

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved