|
You need to know which format the user chooses to enter it in, otherwise how can you tell the difference between:
09/10/2007 (9th October 2007)
&
09/10/2007 (10th September 2007)
Have you considered a calendar control?
|
|
|
|
|
while casting string to Datetime .User IFromatprovider
P.S.
|
|
|
|
|
Hi1 i have an XML file that contains RSS feed data. my task is to read the data of RSS feed into a dataset 7 then to create tables in the dayabase corresponding to each table in the dataset with relationships & primary keys. i have successed reading data into dataset & then inserting into database. now i want maitain relationships among these tables with primary key for each table. can any help me?
|
|
|
|
|
Hi...
Is it posible to delete a file (from a hard disk) after adding it into the database by clicking on a button. (the click event allready stores the file in the database) I want to delete the file (from the hard drive) using asp.net. BUT is it possible to do this using asp.net code???
I am very new to asp.net but have worked with c# before. (and a little vb.net --- but not much)
2nd question... als in ASP.net
How do i gain focus on a control? (lets say "myTextBox")
i thought it should work like this... myTextBox.Focus(); but this is not working... Why not? It seems to work in the form load but not on the button click event???
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
you can delete file if you are having permission to delete it.
Create fileinfo object of that file and then delete it.
And to set focus you can do below code.
private void Set_Focus(string controlname)<br />
{<br />
string strScript;<br />
strScript = "<script language=javascript> document.all('" + controlname + "').focus() </script>";<br />
RegisterStartupScript("focus", strScript);<br />
}<br />
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thank you i will try it
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Hi,
I am developing an application which needs, to open the file in the browser, the file can be of any type (i.e.) Word Document or excel sheet or Jpeg image or any thing
Can any one suggest some mechanism to do this.
I am developing ASP.Net web application with VB.Net
Thanks in advance
|
|
|
|
|
Hi,
you can do Reponse.Redirect("full Path of file")
So it will open file in browser.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
But the browser will only open those file types that it can support within itself. If you try to, for example, open a .cs file, it will open outside the browser.
|
|
|
|
|
Friends,
My cookies value gets reset between every two or three redirect between pages. The cookie value does not reset in mozilla or some version of IEs.
So the problem is not with the code. I have checked everything in IE options also . Wat might be the problem?
|
|
|
|
|
hi everybody,
i just want da info regarding how to write a code when a button is clicked.i hav a few textboxes and some buttons.a letter is to be displayed in textbox where the cursor is focussed when a button containig a text is clicked.for ex if i click button A,then a is to be displayed in textbox.
please help me out.
thankyou...
|
|
|
|
|
Hi,
its realy very simple question
try below code on ButtonClick event.
Double click on button.
Textox1.Text = ButtonA.Text;
Write this code on every button click, just change Button...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Do you want this to happen immediately, or for the page to post back ? If the former, you need to write javascript to run when the button is clicked, to find the textbox control and put text in it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
Does anyone know if using SSL is the best method to provide a secure connecion between SQL Server and a Web Server?
cheers
|
|
|
|
|
Hi all,
I sit with an issue and have absolutely no idea why it is happening.
I have a DropDownList, as follow:
<asp:dropdownlist id="ddlPaymentMethod" runat="server" onselectedindexchanged="ddlPaymentMethod_SelectedIndexChanged">
</asp:dropdownlist>
Then in the code-behind I have the following:
protected void ddlPaymentMethod_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlPaymentMethod.SelectedIndex.ToString() != "")
{
SetDivVisibility(ddlPaymentMethod.SelectedItem.Value.Trim());
}
}
But for some reason, when I run the program, and change the value within the DropDownList, it never enters the SelectedIndexChanged event.....
Any ideas or solutions would be greatly appreciated
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Hi,
set property AutoPostBack = True in Dropdown list...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thanks, working like a dream now.
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Hi
I currently use Visual Web Developer 2005 Express Edition to write .net and c# code.
Does anyone know of any problems with uploading files from Visual Wev Developer to a web server?
cheers
|
|
|
|
|
is there any specific problem that your are facing????
|
|
|
|
|
No I havent encountered any problems.
The reason I ask it because I am currently using VWD to upload to a citrix server and wondered if there was any problems with uploading to a web server?
cheers
|
|
|
|
|
I have a requirement.I have a user control in which based on the enum selection I need to add textbox or combobox at design time.For example if enum value = 0 then textbox should be added in usercontrol - if enum = 1 them combobox should be added.The changing of enum value will be done from form1.Means the
blank user control will be droped on the form.From that from I will change the enum value.Based on that
the control should be created.and the controll should hold all its properties.
Can any body help me for this.
|
|
|
|
|
Hello EveryOne
I want to use Excel file into my web project.So I add reference and use it.
It is run properly into My localHost but when I upload this site into my web server it is not running properly.
And showing following error :
“Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154”
And My method is following which is create the Excel Sheet.....
private void createDataInExcel(DataTable dt)
{
Excel.Application oXL;
Excel._Workbook oWB;
Excel._Worksheet oSheet;
Excel.Range oRng;
string strCurrentDir = Server.MapPath(".") + "\\reports\\";
try
{
oXL = new Excel.Application();
oXL.Visible = false;
oWB = (Excel._Workbook)(oXL.Workbooks.Add(System.Reflection.Missing.Value));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
int intdsCount = dt.Rows.Count;
int iRow = 2;
if (dt.Rows.Count > 0)
{
for (int j = 0; j < dt.Columns.Count; j++)
{
string a = dt.Columns[j].ColumnName;
oSheet.Cells[1, j + 1] = dt.Columns[j].ColumnName;
}
// For each row, print the values of each column.
for (int rowNo = 0; rowNo < dt.Rows.Count; rowNo++)
{
for (int colNo = 0; colNo < dt.Columns.Count; colNo++)
{
oSheet.Cells[iRow, colNo + 1] = dt.Rows[rowNo][colNo].ToString();
}
iRow++;
}
}
oSheet.get_Range("A1", "IV1").Font.Bold = true;
oRng = oSheet.get_Range("A1", "IV1");
oRng.EntireColumn.AutoFit();
oXL.Visible = false;
oXL.UserControl = false;
FileInfo[] files=new DirectoryInfo(Server.MapPath("~\\Admin\\reports\\")).GetFiles("*.xls");
check_login();
string strUserName = Session["UserName"].ToString();
string strFile = String.Concat(strUserName, "_" , "report" , System.DateTime.Now.Ticks.ToString() , ".xls");
foreach(FileInfo fi in files)
{
string[] arrFileInfo = fi.ToString().Split('_');
if (arrFileInfo[0].ToString() == strUserName)
{
if (fi.ToString().Trim() != strFile)
{
fi.Delete();
}
}
}
oWB.SaveAs(strCurrentDir + strFile, Excel.XlFileFormat.xlWorkbookNormal,
null, null, false, false, Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);
oWB.Close(null, null, null);
oXL.Workbooks.Close();
oXL.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRng);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB);
string displayScript = "<script language='javascript'>" +
" winOpen('ExcelSheet.aspx?ExcelFile=" + strFile + "')" +
" </script>";
Page.RegisterStartupScript("PopupScript", displayScript);
}
catch (Exception theException)
{
Response.Write(theException.Message);
}
}
Thnax and regards
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Hi,
I want to develop a comparison chart. For example,
You want to start a new restaurant in a particular place. So, what you do is you will list all the items that are being supplied by the restaurents already available on X-axis and all the restaurents on Y-axis.
Now you put a tick mark against each item taking one restaurent at a time.
item1 item2 item3 item4
Rest1 . .
Rest2 . . .
Rest3 . .
My report should look something like this and i am working in asp.net 1.1
Thank You in advance
Thank you
|
|
|
|
|
|
Hi,
This is from Chandrakanth.
Now i am uploading Image in to Sqlserver2005.
I have written coding like this using Enterprise Library
protected void btnUpload_Click(object sender, EventArgs e)
{
if (upXLTalisma.PostedFile != null)
{
if (upXLTalisma.PostedFile.ContentLength > 0)
{
HttpPostedFile objHttpPostedFile = upXLTalisma.PostedFile;
if (CheckValidFileType(objHttpPostedFile.FileName))
{
int intContentlength = objHttpPostedFile.ContentLength;
byte[] bytImage = new byte[intContentlength];
objHttpPostedFile.InputStream.Read(bytImage, 0, intContentlength);
KF.Search.StoreImage(Convert.ToByte(bytImage));
}
}
}
}
public static bool CheckValidFileType(string strImage)
{
string strImageFile;
strImageFile = strImage;
if (strImageFile.LastIndexOf(".") == -1)
return (false);
int i = strImageFile.LastIndexOf(".");
strImageFile = strImageFile.Substring(strImageFile.LastIndexOf(".") + 1);
return (strImageFile.ToUpper() == "JPG");
}
This is the code i am using in Class file
public static void StoreImage(byte strImage)
{
try
{
Database objDataBase = DatabaseFactory.CreateDatabase();
DbCommand objDbCommand = objDataBase.GetStoredProcCommand("STP_KF_IMages");
objDataBase.AddInParameter(objDbCommand, "@Image", DbType.Binary, strImage);
objDataBase.ExecuteNonQuery(objDbCommand);
}
catch (Exception Ex)
{
throw new Exception(Ex.Message.ToString());
}
}
but i am getting error in this line,
KF.Search.StoreImage(Convert.ToByte(bytImage));
and Saying
"Unable to cast object of type 'System.Byte[]'to 'System.IConvertible'. "
Can any one suggest me what to do for that coding.
Thanks And Regards
Chandrakanth
Chandrakanth
|
|
|
|