|
This way is also an option if you want to hide the entire column.
|
|
|
|
|
|
Hi
I am using StreamReader to read a text file. It works fine when I used to read file from my local system.
But when I mention a Text File's URL which resides on a Web Server then it does not accept path in URI form.
Please let me know how to read text file which does not resides on local machine
Thanks
Lets work it Out.........!
|
|
|
|
|
StramReader sreader = new StramReader(Server.Mappath(@"textfile.txt"));
|
|
|
|
|
Hello Friends,
I am really sorry for this stupid question. But I really have to solve this question:
I want to execute an INSERT command via my save button on my webform.
The procedure like below:
----------------------------------------------------------
string strSQL="INSERT INTO SupplierOperations VALUES (" +
txtOrderNum.Text + ",'" + txtModelNum.Text + "','" +
TextBox1.Text + "," +
.
.
.
.
-----------------------------------------------------------
How can I convert TextBox.Text value to SMALLDATETIME
I have tried Convert.ToDateTime(TextBox1.Text)....But did not work!!
I also copied this code part and tried to run it on to Sql Server Query analyzer and did not work..
Please help...really urgent situation
-- modified at 7:45 Thursday 11th May, 2006
|
|
|
|
|
"Did not work" is not sufficient to help you solve the problem. Post the code used, the error message any any other relevant information.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
First of all,I would like to tell thank you very much for your attention...
The problem is very clear I think..
INSERT INTO tbl1 VALUES
(........)
How can I convert the TextBox string to a SmallDateTime value?
|
|
|
|
|
string strSQL="INSERT INTO SupplierOperations VALUES ("
+ txtOrderNum.Text + ",'"
+ txtModelNum.Text + "','"
+ ddListVendor.SelectedItem.Text + "','"
+ DropDownList3.SelectedItem.Text + "','"
+ txtModelType.Text + "','"
+ txtModelExp.Text + "','"
+ ddlistGrup.SelectedItem.Text + "',"
+ Convert.ToDateTime(Textbox2.Text) + ","
+ Convert.ToDateTime(TextBox1.Text) + ","
+(TextBox6.Text) + ","
+ txtTerminDayCount.Text + ","
+ txtOKcount.Text + ","
+ txtConditionCount.Text + ","
+ txtStopCount.Text + ","
+ txtTotalCount.Text + ","
+ txtControlCount.Text + ","
+ txtMajor.Text + ")";
try
{
CollConnection.Open();
SqlCommand cmd=new SqlCommand(strSQL,CollConnection);
cmd.ExecuteNonQuery();
.
.
Enough??
|
|
|
|
|
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
|
|
|
|