|
Sounds a lot like what I was thinking I'd have to do. Although I don't know why I didn't think of actually inheriting from DateTime. That's probably the easiest to implement.
Thanks
|
|
|
|
|
Now I know why I didn't think of inheritance - DateTime is a struct and you can't inherit from a struct:
from msdn (http://msdn2.microsoft.com/en-us/library/ms173231.aspx[^]) :
"struct
A compound data type that is typically used to contain a few variables that have some logical relationship. Structs can also contain methods and events. Structs do not support inheritance but they do support interfaces. A struct is a value type, while a class is a reference type."
So I'll need a utility or wrapper.
|
|
|
|
|
Arg, I didn't even think about that.
Yeah, you'll have to make a helper class to do that.
|
|
|
|
|
Hi All
Sorry for reposting but it is urgent to me
I am trying to write data in to XML file it is working in local but not in Server
How can i give permission to file to write data
Plz give me an idea
It is giving this error
"Access to the path "D:\inetpub\ftproot\dsolusys.com\applicant.xml" is denied"
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
First off does the account running ASP.Net have read/write permissions to that folder? And do you know what account is running ASP.Net? It might be ASPNET, or it might be the other one used on servers... that I can't remember off the top of my head. Its called something to do with Network Services. It's the one that runs those sorts of things.
|
|
|
|
|
HI all
I am trying to insert data into XML by programetically
It is working fine in local system
But when i upload to server it is giving this error
"Access to the path "D:\inetpub\ftproot\dsolusys.com\Data.xml" is denied."
Why it is giving like this
Any idea ?
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
Security, security, security. The user account under which the ASP.NET process runs on the server would need permission to access that path.
Here's a link[^] that may be useful.
|
|
|
|
|
HI
Thx for reply
I tryed THE CODE
Still it is giving the SAME error
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
Hi
First of all put your XML file under the virtual directory for example you have a virtual directory maped to a specific folder named "Test"
Then put the XML file under "Test" directory
and instead of giving the path like D:/data/....
give path=Server.MapPath("xmlFileName.xml")
it must work!!!
------------
Boss said, develop in J2EE or better, so done in .NET
------------
|
|
|
|
|
Hi
THX
I got it
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
Below code is generating multiple files from the file that the user has uploaded and put the outputs ( multiple text files) to a single file. I am using the NET Zip Library. but, when I run this code, I am getting "size was 1452, but I expected 128028" error on zipos.PutNextEntry(zipentry);
Can you help me to figure this out?
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
try
{
FileUpload1.SaveAs("C:\\ERAFile\\" +
FileUpload1.FileName);
Label1.Text = "File name: " +
FileUpload1.PostedFile.FileName + " " +
FileUpload1.PostedFile.ContentLength + " kb " +
"Content type: " +
FileUpload1.PostedFile.ContentType;
}
catch (Exception ex)
{
Label1.Text = "ERROR: " + ex.Message.ToString();
}
else
{
Label1.Text = "You have not specified a file.";
}
////Find the path/name of the file tha you just uploaded in the server
string filename = "C:\\ERAFile\\" + FileUpload1.FileName;
// string filename = TextBox1.Text;
StreamReader sr = new StreamReader(@filename);
string curDate = DateTime.Now.ToString("yyyyMMddHHmmss");
string strText = sr.ReadToEnd();
sr.Close();
///Generate outputs
ArrayList providers = new ArrayList();
int newPos = strText.IndexOf("~GS");
int curPos = newPos;
string header = strText.Substring(0, newPos);
string footer = "";
while (newPos > 0)
{
newPos = strText.IndexOf("~GS", curPos + 1);
if (newPos > 0)
{
providers.Add(strText.Substring(curPos, newPos - curPos));
}
else
{
int footerPos = strText.IndexOf("~IEA", curPos);
providers.Add(strText.Substring(curPos, footerPos - curPos));
footer = strText.Substring(footerPos);
}
curPos = newPos;
}
string[] arrFooter = footer.Split('*');
string newFooter = arrFooter[0] + "*1*" + arrFooter[2];
int fileCount = 0;
StringBuilder FileList = new StringBuilder();
FileList.Append("The total number of files processed : " + providers.Count + "\r\n");
string filename2 = FileUpload1.FileName.Substring(0, FileUpload1.FileName.Length - 4);
Crc32 crc = new Crc32();
ZipOutputStream zipos = new ZipOutputStream(File.Create(@"C:\ERAFile\"+ filename2 +".zip"));
foreach (string provider in providers)
{
string filename1 = FileUpload1.FileName.Substring(0, FileUpload1.FileName.Length - 4);
fileCount++;
StringBuilder outFile = new StringBuilder();
outFile.Append(header + provider + newFooter);
string fileName = @"C:\ERAFile\" + filename1 + fileCount + curDate + ".txt";
int filesize = outFile.Length;
FileList.Append(fileName + "\r\n");
FileStream fs = File.OpenRead(filename);
byte[] buffer = new byte[outFile.Length];
fs.Read(buffer, 0, buffer.Length);
ZipEntry zipentry = new ZipEntry(filename);
zipentry.Size = fs.Length;
fs.Close();
crc.Reset();
crc.Update(buffer);
zipentry.Crc = crc.Value;
zipos.PutNextEntry(zipentry);
zipos.Write(buffer, 0, buffer.Length);
}
zipos.Finish();
zipos.Close();
Label2.Text = FileList.ToString();
Label2.Visible = true;
}
|
|
|
|
|
There is a part of a web-text:
<asp:Table ID="Table1" runat="server" Height="112px" Width="639px" Visible="False">
<asp:TableRow runat="server" HorizontalAlign="Center">
<asp:TableCell runat="server"><asp:Label ID="LabelRecordNumber01" runat="server" Text="Запись №" Width="78px"></asp:Label>
<asp:TextBox ID="TextBoxRecordNumber01" runat="server" ReadOnly="True" Width="50px"></asp:TextBox>
</asp:TableCell>
<asp:TableCell runat="server">
<asp:Label ID="Label19" runat="server" Text="от 2006/08/13" Width="177px"></asp:Label>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow runat="server" HorizontalAlign="Center">
<asp:TableCell runat="server" BorderColor="Turquoise" BorderStyle="Solid" Width="180px">
<asp:Label ID="Label4" runat="server" Text="John Ponton" Width="172px" Font-Size="Large"></asp:Label><br />
<asp:Label ID="Label9" runat="server" Text="John@gmail.com" Width="172px"></asp:Label>
</asp:TableCell>
<asp:TableCell runat="server" Width="440px">
<textarea cols="1" rows="1" readonly="readonly" id="TextareaMessage01" style="width: 436px; height: 129px"></textarea><br />
<asp:Label ID="Label14" runat="server" Text="Ответ от 2006/08/12" Width="151px"></asp:Label><br />
<textarea cols="1" rows="1" readonly="readonly" id="TextareaAnswer01" style="width: 436px; height: 99px"></textarea>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
I need in my program to assign text value to the TextareaMessage01. I'd like to do:
TextareaMessage01.Text= "Birds are flying";
but VS-2005 doesn't understand this way.
I guess, the answer is around like this:
Table1.Rows[0].Cells[0] ... ???
but what - I do not know. Help, please!
HilSoft
|
|
|
|
|
maybe a TextBox tmpTxtBox = Table1.FindControl("idofcontrol") as TextBox;
?
|
|
|
|
|
Yes, I've found.
The textarea I've replaced to asp:Textbox
and then:
Control ctrl;
ctrl= Table01.Rows[1].Cells[1].FindControl("TextboxMessage1");
TextBox tb= (TextBox)ctrl;
tb.Text="Birds flying";
OK
HilSoft
|
|
|
|
|
I want to build my own CMS something like DotNetNuke as my own site and to distribute it freely.
In addition to that, I have some questions:
1. When Iam adding controls to a PlaceHolers, I want to be able to save the controls in selected PlaceHolder so on next refresh, all controls are where they are supposed to be.
Do I have to save the controls for selected PlaceHolder in database (for example) or there is something already intergrated inside .NET 2.0 (or .NET 1.1)?
I can do it by saving it into the database, but why should I invent the hot water if it's alredy invented inside the .NET 2.0 (or 1.1).
I better ask...
2. I want to list all PlaceHolders on WebForm but this code doesen't work.
What Iam doing wrong?
foreach (Control c in this.Controls)<br />
{<br />
if (c is PlaceHolder)<br />
{<br />
holder.Items.Add(c.ID);
}<br />
}
|
|
|
|
|
Try out this, replace textbox with placeholder that should work.
Public Sub LoopingControls(ByVal oControl As Control)
Dim frmCtrl As Control
oArrayList = New ArrayList
For each frmCtrl in oControl.Controls
If TypeOf frmCtrl Is TextBox Then
oArrayList.Add(New UtilityObj(frmCtrl.ID, directcast(frmCtrl, TextBox).Text))
End If
If frmCtrl.HasControls Then
LoopingControls(frmCtrl)
End If
Next
End Sub
Ram
|
|
|
|
|
I dont understand. What textbox? I don't have a textbox on my WebForms.
You've said to replace textbox with place holders and in your code you are still using textbox O_o.
Iam confused.
Iam aware of, that I have to save the controls I've added on place holders, thats obvious, but I don't know why this code I've suplied don't work.
Sorry, but I don't understand your code as well.
Iam not that good with VB.
|
|
|
|
|
I've solved the problem.
foreach (Control c in Page.FindControl("Form1").Controls)<br />
{<br />
if (c is PlaceHolder)<br />
{<br />
holder.Items.Add(c.ID);<br />
}<br />
}
I didn't thought about Form name and controls inside the Form.
|
|
|
|
|
Hello, I am facing the Problem in with integration of EPDQ(Online Money Deduction )using ASP.Net could any one who can help me out on that matter i would be greatfull to you.
Hussain
Hussain
|
|
|
|
|
Hello,
I am looking for Mike Ellison, and from what i've seen, hes present on the forums this month. :P
Mike, I am using your DataCalendar Class.
I have done some work with it, using the XML version, using a control that allows the XMLDataSource to be updatable (via gridview, formview, whatever). This allows me to add/edit/delete events very easily with your class.
I have a question, and thought you would be the best person to ask.
I am looking to somehow span events accross DAYS. Right now it is working great for one day. I am wondering if you have any idea how I might be able to span events accross multiple days.
What kind of work this would be, and if its even possible with the class/controls avail in ASP.NET 2.0
Any help would be great mike!
thanks!!!
-Shane
|
|
|
|
|
Hi Shane. Thanks for your enthusiasm over the DataCalendar. Just in case you didn't realize: at the bottom of each CP article is a message board dedicated to the article itself. Posts to those article boards are usually sent to the article author, so you may want to address future questions about articles to the article's board.
That being said, I really don't have much to suggest regarding your question. I've done multi-day event reporting by having a stored procedure return one record for each day of the span... it's kludgy, but would work with the DataCalendar as is. Otherwise, I think you would be building a custom control to handle multi-day event presentation.
Sounds like a good CP article... care to write it?
|
|
|
|
|
some one forward some codeing on omi98me205@hotmail.com
thanks
-- modified at 11:33 Wednesday 9th August, 2006
omi
|
|
|
|
|
|
What do you mean by adding dataadapter to datagrid, the statement looks contradict. Can you please clearly explain your requirements?
Ram
|
|
|
|
|
datagrid property tabel show some property such as
datasource:?
datakeyfield:?
what is it mean
omi
|
|
|
|