|
This works
begin tran
update table1 set col1 = col1
......now user hase exclusive lock until you either update or commit the transaction, BUT it does mean nobody else can read the record until the commit/rollback, which could ba a long time - for example user goes to lunch. VERY BAD PRACTICE.
Normally you have a column on your table, (usually a timestamp or sequence number) and you read it before applying changes to ensure the record has not changed since the original read.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Quite true, one observation though:
Depending on database settings, other users can read the original data while X-lock is on the row.
SQL Server uses nowadays multiversioning like for example Oracle. However, if I remember correctly, it's not enabled by default.
The need to optimize rises from a bad design
|
|
|
|
|
Check this out:
Lock
Lock2
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Hi,
I want to autocomplete the textbox value according to the listbox items in .net 2.0. Please give me an idea to implement this.
Thanks.
|
|
|
|
|
Do you mean you want somone to click on the listbox and then the value from the listbox appears in the textbox?
If so this is fairly simple as you just set the listbox to AutoPostBack = True and on the Postback take the selected value and put it in the textbox.
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
|
hy,
can any one tell me that how can i read the contents of a MS word(.doc) file on a webpage(.aspx page).
i tried to use filestream but whenevr i run it..i get a option to open or download the doc file which resluts in opening the word file but not the content of the word file on the web page.
the code that i used was
Response.ContentType = "application/ms-word";
Response.AddHeader("content-disposition", "attachment; filename=SFA & CRM.doc");
string a = Server.MapPath("SFA & CRM.doc");
FileStream sourceFile = new FileStream(a, FileMode.Open);
long FileSize;
FileSize = sourceFile.Length;
byte[] getContent = new byte[(int)FileSize];
sourceFile.Read(getContent, 0, (int)sourceFile.Length);
sourceFile.Close();
Response.BinaryWrite(getContent);
plz helpl me out..
regards
modified on Friday, October 10, 2008 4:00 AM
|
|
|
|
|
Hi,
Please know that Word .doc files are in a proprietary Microsoft binary format. They can only be interpreted correctly by the Office Word engine or a third party control suited for this purpose.
You may consider using the Office PIA (Primary Interop Assemblies), automate Word and open the document in it, and extract the relevant portions from the same, preserving the formatting.
Hope this helps.
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
I have been developing web site run on IIS and Internet Explorer 6.0. When That site run different browser 7.0 or 8.0 or opera then Designing view probleam
modified on Friday, October 10, 2008 1:51 AM
|
|
|
|
|
This is normal. Thats why web developers spend hours working around cross-browser compatability issues.
All you can do is make changes to your css to get round it.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi all,
Can anybody help me out in using listbox items in the where clause of a SQL Query like "Select * from TableName where ColumnName In(Listbox Items)"
Thanks in advance
|
|
|
|
|
You can create a stored procedure and then in your c# set the value of the column name to Listbox.SelectedItem.Text
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
We have several PDF forms that we use, which call a submit.aspx to do some emailing of the form data as well as document storage (ImageRight).
Every time we submit the PDF, it calls the Page_Load sub twice. I realize this COULD be an Adobe issue but we're not getting much response from them and I feel there might be some way to check why it's happening in the code and capture it so we can stop the second process.
Anyone else ever see this problem?
|
|
|
|
|
If the Page_Load method is written in VB and it has a 'Handles' clause and also you have 'AutoEventWireup' set to 'true' on the aspx page, then Page_Load will fire twice. ('AutoEventWireup = true' causes all methods starting with "Page_" to be interpreted as event-handling methods for the corresponding page event).
If this is the case, either drop the 'Handles' clause or set 'AutoEventWireup' to false.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
I’m getting an intermittent false negative on the call “if (!System.IO.Directory.Exists(folder))” in code in an ASP.NET 2 web site [1]. The folder clearly exists, and even contains a log file that is written to when the CLR doesn’t lie about the folder’s existence. Any help would be appreciated.
[1] BugTracker.NET
|
|
|
|
|
Hi All,
I an working on a website and I am trying to implement a tabbed form in ASP .NET.
I did like following in .aspx page:
<asp:menu id="Menu1" width="165px" runat="server" orientation="Horizontal" staticenabledefaultpopoutimage="False" onmenuitemclick="Menu1_MenuItemClick" xmlns:asp="#unknown">
<items>
<asp:menuitem text="" value="0">
<asp:menuitem text="" value="1">
<asp:multiview id="MultiView1" runat="server" activeviewindex="0" xmlns:asp="#unknown"> <asp:view id="Tab1" runat="server">
Contents of the Sub form
<asp:button id="cmdAdda" runat="server" text="Add the Record" tabindex="13">
|
<asp:view id="Tab2" runat="server">
Contents of the subform
<asp:button id="cmdAddb" runat="server" text="Save the Record">
|
And the code in vb .net is:
Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
Dim i As Integer
MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value)
i = e.Item.Value
Label2.Visible = False
If (i = "0") Then
Me.Menu1.Items(0).ImageUrl = "~/selectedtab_app.gif"
Me.Menu1.Items(1).ImageUrl = "~/unselectedtab_tut.gif"
ElseIf (i = "1") Then
Me.Menu1.Items(0).ImageUrl = "~/unselectedtab_app.gif"
Me.Menu1.Items(1).ImageUrl = "~/selectedtab_tut.gif"
End If
End Sub
The problem is that when I click on the second tab, it is not getting clicked ( the value of i is not being 1 so that the next sub-form is not getting shown).
I am highly seeking for help.
Thanks,
|
|
|
|
|
Hi,
I get inputs from a formview and then place the data inside a listview via an ObjectDatasource. The binding is a "two way binding" for every control in formview. However when I insert data, the listview doesn't show anything, just adding empty rows.
I decided to check if data was reaching to ObjectDataSource_Inserting procedure and the answer was "YES". I wonder why? Do I have to add data manually inside the Listview_ItemCreated or Listview_ItemInserting procedures? I thought that there was no need to do it. What template should I use in listview for just displaying data? I have used ItemTemplating.
If you enlighten me about the solution, I would appreciate it.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Friends,
I'm preparing a quiz in asp.net using sql server 2005 as backend.
Now i want two things in that
1. a timer - i'm trying from last 3 days and used all methods given in asp.net
2. dynamically create panels - tried also this but no way find to create that.
help me out
|
|
|
|
|
sachees123 wrote: 1. a timer - i'm trying from last 3 days and used all methods given in asp.net
did you try with AJAX Timer Control ?
sachees123 wrote: 2. dynamically create panels - tried also this but no way find to create that.
Why ? what problem you are getting ?
Try This
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
Panel P = new Panel();<br />
Label l1 = new Label();<br />
l1.Text = "Hi All";<br />
P.Controls.Add(l1);<br />
this.Controls.Add(P);<br />
}
or any thing else ?
Let me know if any issue
cheers,
Abhijit
|
|
|
|
|
hi abhijeet,
thanks for ur supportive reply...
well i didnt try with AJAX timer control... as i dont know how to use that..., im trying to create my own timer...using c# and asp.net. Help me in while condition, that how should i control seconds....
=========================================
public void counter()
{
int sec = 60;
int min = 20;
while (min != 0)
{
while (sec != 0)
{
sec--;
TimeSpan t = new TimeSpan();
//t.Add(t.Seconds()).ToString();
lbltemp.Text = t.Seconds.ToString();
}
min--;
}
}
========================================================
and in panel what u gave is i tried but im creating an array of panel.
static Panel[] p = new Panel[10];
now if u can help me out...
|
|
|
|
|
Try This For Ajax Timer Control
Ajax Timer Control Article[^]
For Array of Panel Creation is the similar way that i have mention for a single panel. you have to create for arry of pannel .
cheers,
Abhijit
|
|
|
|
|
Hi,
I am using .net 2.0. I want to connect the db dynamically using web.config. I have to pass the db name only at runtime. The server name, uid, password are static in web.config. Please help me to implement this.
Thanks.
|
|
|
|
|
Try to use System.Web.Configuration NameSpace There is a class WebConfigurationManager .This class allow you to accss web.config programmaticaly. For Every Section in web.config there is a Class in this namespce, like For AppSettingsSection there is a class AppSettingsSection , Similary for ConnectionString There is a Class ConnectionStringSection .
You can retreive information by WebConfigurationManager.GetSection() .
Now try to explore this area what ever i mention and try to implement. if you have anmy issue then ask me !!!
Good luck
|
|
|
|
|
Hi,
I want to change the db according to the current month. I come to know that changing db in web.config at run time will restart the entire application. So, I used Global.asax to store the connection settings and i got it. Thanks for your reply.
|
|
|
|
|
Hi all,
I do want to create a template how it is........
The templates like when we are select a particular project type it will shows windows project ,webapplication templates.......like i want to creat a own template for me........
|
|
|
|