Showing posts with label created. Show all posts
Showing posts with label created. Show all posts

Wednesday, March 21, 2012

install error

I have tried to change the name of the file in the regedit and I am still receiving the same error that a previous program installtion created pending file operations on the installation machine. You must restart computer before running setup. What do I do now? i ahve restarted 3 times.


mlissaw

Can you try this?

1. Run command regedit.

2. Check whether the the key

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Pendingfilerenameoperations

exists. If yes, please remove it and reboot the machine. Then you can retart installing.

|||

Also please review the following before you modify registry...

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 (http://support.microsoft.com/kb/256986/EN-US/) Description of the Microsoft Windows Registry

|||

I tried this process with backing up the registry and it did not work. any other suggestions?

install error

I have tried to change the name of the file in the regedit and I am still receiving the same error that a previous program installtion created pending file operations on the installation machine. You must restart computer before running setup. What do I do now? i ahve restarted 3 times.


mlissaw

Can you try this?

1. Run command regedit.

2. Check whether the the key

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Pendingfilerenameoperations

exists. If yes, please remove it and reboot the machine. Then you can retart installing.

|||

Also please review the following before you modify registry...

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 (http://support.microsoft.com/kb/256986/EN-US/) Description of the Microsoft Windows Registry

|||

I tried this process with backing up the registry and it did not work. any other suggestions?

Friday, March 9, 2012

Inserts with and without a clustered index...

Hi,
I created 2 identical tables with just 12 records each. Then I created a clustered index in one table, but not on the other. I then tried inserting 2 identical records in both the tables. I guessed that in the table without the index the insertion would be faster, because there is no overhead of re-ordering the table based on the clustered index. I found that the insertion is actually faster on the table with the clustered index. How is this possible? Isn't inserts supposed to faster on heap files?A while ago I looked into the same matter but found that inserting rows in a table with/out indices took an equal amount of time, that is, the overhead of updating indices didn't change anything. I had quite a bit more rows than 12 though.

Having that said; I'm not exactly sure how to interpret these kind of results anyway. There could be a lot of influences that affect the sql-processes running in the background that again influence the select or insert results. The only thing I concluded was that, in _my_ case, it didn't matter that much.|||Well, if your table structure is like this create table dbo.t1 (
f1 int identity(1,1) not null primary key clustered,
f2 char(1) null)
then there is no difference. But if it's like this create table dbo.t2 (
f1 uniqueidentifier not null primary key clustered,
f2 char(1) null) then your INSERTS are going to be slower than if you remove CLUSTERED from your PK.

In addition, it's not the presence of the clustered index that imposes overhead, it's non-clustered indexes that require any action query to be accompanied by an implicit update of index pages.|||Thanks guys for the replies. But, doesn't having a clustered index mean that the records in the table are to be physically sorted? Therefore even if there is enough space on the page which should contain the record being inserted, the DBMS would still have to search for that page and insert the record, as opposed to simply appending it at the end, in the case of a heap file (unindexed file).
Maybe I see this in my example because the table is too small and everything fits into one disk page. How do you think my observations would have been if the table had a million records?|||It still goes to the last extent allocated to the table but does a simple check - is the new value greater than the last value? If the answer is YES - that's the end of the story. Else, - then we are gonna be talking about the overhead of the clustered index.

Sunday, February 19, 2012

Inserting Records

Hi,

I'm using VWD 2005 Express with SQL Server 2005 Express. I've created a page "create.aspx" which will be used to insert records into a table within the database.

I've used the DetailsView control together with a SqlDataSource control on the create.aspx page.

When I run the create.aspx page it retrieves the first record in the table of the database becuase the SqlDataSource is obviously performing a"Select * from Table" command.

I don't want this to occur. I want an empty page with no records. I know I can set a WHERE clause to a value that will never return any results but I don't beleieve this is an elegant way of doing things becuase I am 'hitting the database' for no reason other than to get the table structure poplutaed into the DetailsView control.

Questions:

1. Am I using the right controls? (in particular the SqlDataSource control)

2. Is there a better way of doing this?

Your advice is most appreciated. Thank you

Try a formview with the defaultmode set to insert.

|||Motley, Thank you - that works just fine|||

Hi, I'm stuck again. Beginners bad luck.

Let's say I have a database with one table e.g. AccountsTable and this table has several fields such as:AccountID, AccountName, AccountDate, AccountActive etc.

I'm using the FormView with the DeafultMode set to Insert with:

<asp:TextBoxID="AccountDateEstablishedTextBox"runat="server"Text='<%# Bind("AccountDateEstablished") %>'></asp:TextBox>

How do I access and assign the database field?

I would like to programmatically take control. Say for example in the Sub Page_Load (not sure if this is where it should go) have something like

AccountDateEstablished = now

But I get the message saying AccountDateEstablished is not declared. Obviously, it's not referring to the same thing as what I have in mind i.e. I think it's looking for a variable in the codebehind file; when what I want is to have some logic that assigns this field in the database the value of 'now' i.e. this moment in time e.g. 21 Feb 2006.

I have the same issue with a CheckBox used for the AccountActive which is a Bit (I assume this means Boolean). All I want is for it to default to 'True' when the page loads

Another issue also closely releated. If I place a Calendar control otside the FormView then I can access the value Calendar1.SelectedDate as a vlaue in the SqlDataSource1 propoerty InsertQuery, choose AccountDateEstablished and choose from 'Control' form the Parameter Source drop down. However, if I place the Calendar control within the Formview then I cannot access this control or value.

Also, if you had a regular aspx page with a button then I could place some logic in the Click event to check for certain conditions etc. How do you do this with the prewritten FormView "Insert" Linkbutton (or Button)?

Thanks

|||

You don't assign the value to the database, the values don't get written to the database until you actually click the insert button.

It looks like you are binding the AccountDateEstablished to the AccountDateEstablishedTextbox, so if you want it to get written when you click insert, you can of course, just do:

AccountDateEstablishedTextbox.text=now

Of course, that let's the user edit the text, if that is not what you wanted, then don't bind it to a textbox, and on page load, you can do something like:

SqlDataSource1.InsertParameters("@.AccountDateEstablished").defaultvalue=now

And make the AccountDateEstablished a Parameter instead of a ControlParameter. You can also set the value during the SqlDataSource1_Inserting event.

Same for the checkbox. If you want the default to be checked, then set it as checked in page load, or if you always want it to default to checked, then just set the property of the checkbox to checked=true.

Try placing the SqlDatasouce within the formview and see if that fixes your calendar issue -- but I'm not an expert on this, I've avoided the FormView controls, etc. so far.

I would go to the code behind page, select FormView in the upper left dropdown, then see all the events I could catch in the upper right dropdown, I'm sure there is one in there that would be helpful.

|||

It looks like you are binding the AccountDateEstablished to the AccountDateEstablishedTextbox,(Yes, the system did that for me) so if you want it to get written when you click insert, you can of course, just do:

AccountDateEstablishedTextbox.text=now

Of course, that let's the user edit the text(That's fine - the easy way for now [I don't know the difference between Parameter and Control Parameter]).

Prior to submitting the post, and yet again upon your response, I have tried this in the code behind under several different combinations (upper left and right drop downs) but I keep getting the squiggly line NAME'AccountDateEstablishedTextbox' is not declared

I even triedFormView1.AccountDateEstablishedTextbox.textwith no joy i.e. I get the same message of not declared. Do I have to try each and every combination? I feel like I am missing something big here

Normally you can access a control properties in code as you mentioned withAccountDateEstablishedTextbox.text=now, but this FormView seems to be behaving differently by 'hiding the textbox control' that it created

The page has a master page, does that have any side effect?Thanks

|||

I would recommend asking that question in the data presentation controls forum. Hopefully they have a better solution for you than the only one I know of which is to do something silly like this:

CType(FormView1.FindControl("AccountDateEstablishedTextbox"),textbox).text=""

I finally realized that the FormView was wasting more of my time with sillyness like that than to just load and insert my own data so I chucked it, and did that instead.

|||

Hi Motley,

Thanks for better suggesion for inserting records. I was also face problems when i inserting hidden values. Finally I did using "e.Command.Parameters["@.EmployeeID"].Value = Profile.EmpID;" using SqlDataSource1_Inserting event.

FormView/DataList controls seems to simple when I see webcast events but it acutally time consuming at real time development. esp Inserting / Display records.

Regards,

Gopinath,