|
in my situation in one click event i have to insert data into a sql table as well as oracle table.Now i want to use transactions but the problem is either i have to use oracle transaction which does not support oracle command or sql transaction which does not support sql command.What i have to do in this situation.I want to do that if one of the two query fails to execute other one must be roll back.
Thanx in advance
|
|
|
|
|
I've never had to deal with transactions across two different providers (oracle and sql server) before but here's something off the cuff. How about adding some kind of 'Pending' state to the inserts
1. Perform first insert (pending)
2. Perform second insert (pending)
3. Validate both have inserted
4. Update first (live)
5. Update second (live)
I know there's still a window for something to fail between operations 4 and 5 but it's much less likely than a failure between 1 and 2 (due to constraints you might have on various fields). A Transaction would be better but this is an option.
|
|
|
|
|
Hi iam working in a project, this is one of my stored procedure which neither allows you to insert duplicate vendor, nor either duplicate email.
but i am wondering whether this is the correct method of doing validation or i create 2 more store procedures 1 for checking duplicate vendor names another for duplicate email and 1 for insertion of vendor record.
ALTER PROCEDURE [dbo].[InsertVendorDetails]
-- Add the parameters for the stored procedure here
(
@strVendorName varchar(50),
@strPrim_Con varchar(12),
@strSec_Con varchar(12),
@strEmail varchar(50)=null,
@strAdd varchar(500),
@result Int output
)
AS
BEGIN
If Exists( Select Vendor_Name from Vendor where Vendor_Name=@strVendorName)
Begin
set @result = 2
End
Else
Begin
If Not Exists(Select email from Vendor where email=@strEmail and email is not null)
Begin
INSERT INTO VENDOR(VENDOR_NAME,PRIM_CONT_NO,SEC_CONT_NO,EMAIL,[ADDRESS])
VALUES(@strVendorName, @strPrim_Con, @strSec_Con, @strEmail, @strAdd )
set @result=@@Rowcount
End
Else
Begin
set @result = 3
End
End
END
“You will never be a leader unless you first learn to follow and be led.”
–Tiorio
"Coming together is a beginning, staying together is progress, and working together is success." Henry Ford
|
|
|
|
|
Programmers always do things Differently,
The First thing i would do i will have a Stored Procedure to check if the e-mail exists and the Vendor name Exist if they dont exists then do the Insert.As i see you have tried to handle them from one SP. Mybe if you can create a SP for checking an e-mail and another one for name and call them from your BLL and check against their return and do decision based on that.
Hope it make sense
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
I have to print a UPS shipping label on thermal printer (upslabel.cps). I
initially had the label information in a base64 string which I decoded into a
memory stream. Now I need to send this memory stream to a thermal/label
printer. How do I do this?
I have tryied following code.
its working well for gif string formate but not working in epl string format
string sUploadLabelFileName = "c:\\prem\\label.cps";
string GraphicImage;
GraphicImage = "mystring" ;
char[] data = GraphicImage.ToCharArray();
Base64Decoder myDecoder = new Base64Decoder(data);
StringBuilder sb=new StringBuilder();
byte[] bt64 = myDecoder.GetDecoded();
FileStream sw = new FileStream(sUploadLabelFileName, FileMode.CreateNew);
sw.Write(bt64, 0, bt64.Length);
please help
prem
2
modified on Thursday, February 19, 2009 10:00 AM
|
|
|
|
|
Hi Friends.....,
i can take Modal popup control.using that control display one panel.
in that panel design two fields like email and password, i can take one ADD button,
how to insert values when clicking on ADD button.
|
|
|
|
|
just add an OnClick event handler to ADD button and in this handler you may access the fields and insert whatever you want.
Calin
|
|
|
|
|
just to back up the previous response - you implement it the same way you'd implement it if you wasn't using the modal popup.
Presumably your button is an asp:Button so create your event handler (if you don't know how to write it manually then just double click it in your IDE designer) and add your code. When the button is clicked by a user it will cause a postback and your code will execute.
Have you managed to get your modal box popping up ok?
|
|
|
|
|
hi,
I have page named webform.aspx,in this page i retrived the values from the database to the hiddenfields in the webform page.Now i want to access this hidden field values in the htm page named index.htm
webform.aspx
Hiddenlat.Value= ds.Tables[0].Rows[0]["lat"].ToString();
Hiddenlang.Value = ds.Tables[0].Rows[0]["lang"].ToString();
In index.htm iam trying to access the values of the hidden fields
of the webform.aspx page
index.htm
var lat1=form1.getElementById("Hiddenlat").value;
var lng1=form1.getElementById("Hiddenlang.").value;
but iam unable to acess the hidden field values in the index.htm
Note: we r using iframe for webform.aspx
Thanks in Advance
|
|
|
|
|
Hiya,
try
var lat1 = window.frames(0).document.getElementById('HiddenLat').value;
Works for me - hope it works for you, too
Btw, this is my first post here, hello everyone.
|
|
|
|
|
thanks for reply
i tried that but i did not get
acutally how i am using is
webform.aspx
<html>
<body>
<iframe src="index.htm" />
here is the hidden control with id Hidden1
</body>
</html>
index.htm
<html>
<body>
here i want to show the webform.aspx pages hidden values
</body>
</html>
how to show the hidden control values in index.htm ??
|
|
|
|
|
Sorry, I must have misunderstood your need.
So the iframe is IN the aspx page, not the other way round.
In the script of index.htm use:
var lat1 = window.parent.document.getElementById('Hiddenlat').value;
If that doesn't help i dont know what will.
|
|
|
|
|
thanks buddy.
it was very helpful to solve the problem...
|
|
|
|
|
Hello friends,
m having some problem with dropdownlist, in my code i have to save the selected value in the database and after it i need to remove it from the dropdownlist,
my code is as below
<br />
LevelDBMLDataContext dt = new LevelDBMLDataContext();<br />
LevelMaster lmas = new LevelMaster();<br />
lmas.KMLevel_number = Convert.ToInt32(ddlLevelNumber.SelectedItem.ToString());<br />
lmas.KMLevel_Name = txtLeveName.Text;<br />
lmas.KMLevel_Description = txtDescription.Text;<br />
lmas.KMLevel_Status = getStatus();<br />
dt.LevelMasters.InsertOnSubmit(lmas);<br />
dt.SubmitChanges();<br />
ClearControls();<br />
fillLevelNumber();
but since page load occur before the click button click event it is not working.please help me ...........thanks
|
|
|
|
|
Hi,
How can i maintain server time and client area time.If a client save his local time and location in database, how can i compare with server time.
eg:
A user from india set Indian time and save to server in usa, next time when the user enter he want to check the time he saved.How can i compare time with server time?
thankyou,
yesu
|
|
|
|
|
i think your question is wrong?
when user can login in the system the time or date is save in the database
is server time. its not the client system time. so you don't need to
comapare time?
reply if you need more clarification.
or justify your question in more details.
Regards
Keyur Satyadev
|
|
|
|
|
Hi,
I need to start an action when the saved local time reached. How the server identify the local client time reached?
for eg:
Time saved by a user in india : 5:30 PM.. Server time is 12 PM
When the indian time 5:30 pm reached an action will start.
In server how i will know indian time 5:30 reached?
or how can i know Indian time 5:30 is equal to server time 12 PM?
Thankyou
|
|
|
|
|
Convert the server time into GMT time (UTC) while saving in the database. similarly convert the GMT timings to your local time while retriving and comparing
in More detail here you go:
While saving the server time save it in UTC/GMT time format and at the time of comparision convert the local time to GMT time and compare the time with database time (where as database time is in GMT format) .
i hope this will solve your problem. if get other alternative which more suited for your problem rather than this solution.please revert back with your solution
have a great day ahead .
Thanks,
Rajesh Chinnam
|
|
|
|
|
please tell a site to read about all dll's in asp.net
|
|
|
|
|
You should close your browser, close your IDE, buy a book on C# or VB.NET and read it, then buy an ASP.NET book and read that. It's plain that you don't have the basic skills necessary to be using ASP.NET right now. You should instead learn some C#, and get a grasp on some basics, so that when you ask questions here, they are not really trivial, and you know enough to be able to understand the answers.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Why dont you tell it yourself
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
www.ITS.co.za
|
|
|
|
|
when u build your project DLL can be automatic generated.just you have to build your class]
library project.
Refards,
Keyur Satyadev
|
|
|
|
|
Hi,
I am using SQL Server Reporting Services to create Reports in Buiness Intelligence studio. I have created applied the Tree view structure for groups in Report using the Toggle visibility option. I have illustrated the structure of my report below:
Header :
ProductLine|ReasonCode|UnitType |Qty
-------------------------------------
Detail:
-------------------------------------
- E
Reason
- IO2Failure
COG 100
+ T
+ U
-------------------------------------
The + and - indicates the tree structure.Assume (-E,+T,+U) parentnode, (-IO2Failure) Child Node
I think you could understand the structure. The problem is i want to give some option in dropdownlist to user such as CollapseAll, ExpandAll, Expand only ProductCode. As i am not much experience with SSRS i dont know how to apply the ExpandAll and Collapse All options. Please Help me!
Tnx.
With Regards,
Anand
|
|
|
|
|
hello friends i want to write an application which runs in background and sends a mail to me in every 5 minutes
I would like to know .. Is it possible via WEb service ? or web application ?
I dont want to Open any web page for this .
Thanks Tiwari
No Longer a Dot Net Programmer ...
|
|
|
|
|
Use window service to do this
Satish
|
|
|
|