|
hi
just try with this.
DateTime tempTime = Convert.ToDateTime(DateTime.Now.Tostring());
textbox1.text=tempTime.ToShortDateString();
and call this textbox1 in sql statement
Bhasker
|
|
|
|
|
Thank you very much for your attenton...But Unfortunately the result is not correct...
I really wonder is this really an IMPOSSIBLE question???
|
|
|
|
|
You really need to be using parameters instead of concatenated strings. Not only is it faster, but it's safer.
Since you only had 3 fields in your insert statement, that's all I put in this example
SqlConnection conn = new SqlConnection();
conn.ConnectionString = "Your_Connection_String_Here";
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = @"INSERT INTO [SupplierOperations ] VALUES (@orderNum, @modelNum, @other);";
SqlParameter p1 = new SqlParameter();
p1.SqlDbType = SqlDbType.NVarChar;
p1.ParameterName = "@orderNum";
p1.Value = txtOrderNum.Text;
SqlParameter p2 = new SqlParameter();
p2.SqlDbType = SqlDbType.NVarChar;
p2.ParameterName = "@modelNum";
p2.Value = txtModelNum.Text;
SqlParameter p3 = new SqlParameter();
p3.SqlDbType = SqlDbType.SmallDateTime;
p3.ParameterName = "@other";
p3.Value = TextBox1.Text;
cmd.Parameters.AddRange(new SqlParameter[] { p1, p2, p3 });
cmd.ExecuteNonQuery();
Found on Bash.org
[erno] hm. I've lost a machine.. literally _lost_. it responds to ping, it works completely, I just can't figure out where in my apartment it is.
-- modified at 13:11 Thursday 11th May, 2006
|
|
|
|
|
what should i do that the page(form) be not refresh when i click the button in asp.net(c#). my mean is: when i click the button the form the page moved and hurled or shot at first time for refreshing. the page move up and down first time and then be stop.
is it possible than it be stop like windows application?????????
|
|
|
|
|
what should i do that the page(form) be not refresh when i click the button in asp.net(c#). my mean is: when i click the button the form the page moved and hurled or shot at first time for refreshing. the page move up and down first time and then be stop.
is it possible than it be stop like windows application?????????
|
|
|
|
|
|
do you have sample code for smartNavigation? must assign to what object?
|
|
|
|
|
You can set the value SmartNavigation in the page directive of the aspx page.
Best Regards,
Apurva Kaushal
|
|
|
|
|
it's not object it is Property of Page.
In Load event of your application set as this
this.Page.SmartNavigation = true
But if you have any dynamic meny you have to be carefully because it deformation deynamic menu. In other boject works good like windowsapp.
|
|
|
|
|
when i used smartNavigation that is not diffrent and again my page refresh and .... and my menu be destroyed.
|
|
|
|
|
Hi,
I have a masterpage with some divisions and a placeholder in it. In that placeholder is an Iframe.
Now, I would like that Iframe to be as big as it needs to be. In Internet Explorer it works perfect. But in Firefox I have this tiny box with scrollbars.
How can I get the Iframe as big as it needs to be, in Firefox?
I managed to set the width of the Iframe with Jscript but somehow, the same doesn't apply to the heigth.
Code:
var currentfr=document.getElementById("ctl00_PlaceHolderPSAHNNIntranet_iFrameRunningApplication");currentfr.width = currentfr.contentDocument.body.offsetWidth; currentfr.width = eval(currentfr.width) + eval("16");
Help would be greatly appreciated.
|
|
|
|
|
I found this link at WebDeveloper which has a good discussion on your issue.
http://webdeveloper.com/forum/showthread.php?s=8c4c2466058beb5a1ae2c8be595c3524&t=85762"
Hope it helps!
|
|
|
|
|
Ookay,
After about a full day searching on the internet I finally found a solution.
<br />
function resize_iframe()<br />
{<br />
var currentfr=document.getElementById("ctl00_PlaceHolderPSAHNNIntranet_iFrameRunningApplication");<br />
var detect = navigator.userAgent;<br />
place = detect.indexOf("MSIE");<br />
<br />
if (place == - 1)
{<br />
currentfr.width = currentfr.contentDocument.body.offsetWidth; <br />
currentfr.width = eval(currentfr.width) + eval("16");<br />
<br />
currentfr.height= currentfr.contentWindow.document.documentElement.scrollHeight +16;
}<br />
else
{<br />
currentfr.height = currentfr.Document.body.scrollHeight;<br />
currentfr.width = currentfr.Document.body.scrollWidth + 15;<br />
}<br />
} <br />
Now I only need to find out how to get the Iframe to become smaller again, after a larger page had been inserted into it.
Edit: I found a solution for that aswell. Just put
<br />
currentfr.height = 15;
in the begining of the function. This will sort of reset the height.
-- modified at 9:07 Thursday 11th May, 2006
|
|
|
|
|
hi all,
ok so I have an object in my business layer. With constructors,
properties and methods.
How do I bind an objectdatasource to my object? say the constructor?
pass in an ID to it that would fill the object and in turn the
ODS. And then bind the insert, delete and update tabs to appropriate
methods of the object.
is this possible?
thanks
M
|
|
|
|
|
You might want to read the tutorial in MSDN to see how to use the ObjectDataSource[^].
|
|
|
|
|
Hi,
I think my problem is related to caching so here goes...
I have a web page in 'Application A' that retrieves data in the form of xml from a webservice exposed by 'Application B' - let's call it a list of tasks. The list of tasks is devided into two groups (outstanding and completed). Each task in the 'outstanding' list has a hyperlink. When the user clicks this hyperlink they are redirected to 'Application B' where they complete the task . 'Application B' sets the status of the completed task to 'completed'.
When the user returns to the list of tasks in 'Application A', the completed task needs to drop into the 'completed' list. This is however NOT happening, even if the page is refreshed (not even ctrl+F5 refreshes the lists). Upon testing I found that the data returned by 'Application B's webservice does refresh so the webservice is not the problem.
I have found if I reset IIS the page DOES refresh, so something is being cached somewhere.
I have tried the following so far...
In the code behind page I have included the following statements in the Page_Load() event handler
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetAllowResponseInBrowserHistory(false);
This didn't make a difference.
I have also tried a page directive:
<%@ OutputCache NoStore="true" Location="None" %>
This didn't work either.
Any ideas?
Regards,
Morné
Morné
|
|
|
|
|
Make sure if you are displaying data in data grid EnableViewState should not be true (if data grid is the case this can be one problem).
before updating data (after refresh)
Cache.Remove("myTasks" )
then add new cache data
Chinna Srihari
Tech Lead, Capgemini
|
|
|
|
|
Hi Chinna,
Thank you for answering my question so quickly.
I'm displaying the data using a <asp:DataList> control with an <asp:XmlDataSource> as the datasource.
Setting the EnableViewState property of the DataList control to 'false' did not make a difference, but your suggestion made me also check the properties of the XmlDataSource control. It turns out that the XmlDataSource control has a property called EnableCaching which I then also set to 'false'... PROBLEM SOLVED!
Thank you for pointing me in the right direction.
Morné
|
|
|
|
|
Hi to all,
how to change port 25 to 80 for smtp mail server?
thanks,
Bhasker
|
|
|
|
|
Go to "Default SMTP Virtual Server" properties in IIS
Click on Advanced button
and Edit the default port
Hope this helps.
Chinna Srihari
Tech Lead, Capgemini
|
|
|
|
|
Also make sure
You cannot have two applications listening on the same port. So you need to
either configure the other application to listen on another port, or close
the application
Chinna Srihari
Tech Lead, Capgemini
|
|
|
|
|
Hi all
I installed WSE 3.0 and watched the Labs to learn how to apply security in my project. The problem is that in the Labs they use a Windows apllication and not a Web site. In the Labs u can see they got in the reference a file called Reference.cs .. what i don t have in my web site project (client side). I saw they change the "Policy" and use a method : proxy.SetPolicy(Policy); . So my question is : do i have to make a method for my Web Service and if yes .. how i can change the policy.
Thx a lot
|
|
|
|
|
Hi I want to create Directories and Files in my project. But I don't want to use static methods of System.IO.Directory and System.IO.File because they are causing exceptions for some methods that this file is being used by some other process. How can I do this with classes from which we can make instance objects. I don't want to predefine the path or the file while creating new instance of the object.
Thanks,
Sandy
|
|
|
|
|
If you are trying to write to a file that is in use, then it wont make a difference how you try, you wont get to write to that file.
Using the static File and Directory methods is no different to using FileInfo and DirectoryInfo - which respectivly are the "instance" versions that you refer to.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
In my application , I am uploading the images from the client. Then I am creating Directories to save those files. I have also functions to delete those files if the user want to do so. But after deleting the file and again uploading the new file to the same location give me the exception that this path or file is being used by another process. Now I am using FileInfo static methods to delete and save file but when I want to save file using FileControl by FileControlName.PostedFile.SaveAs(FilePath) method, it raises the above said exception.
Thanks,
Sandy
|
|
|
|