|
If you have worries about speed, a DB is going to be the fastest.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
As CG said, DB is fast.
ChrisFarrugia wrote: However with xml there will be problems with parsing because of the html tags.
There won't be if you put the HTML content to a CDATA section.
|
|
|
|
|
Hi all.
I have written a simple application in vb.net (2.0) that reads data from an excel sheet (previously stored in focus databases) and stores it into a sql server database. I am using typed datasets and table adapters to store the data. I have an "Import" button whose event handler does the following in turn.
1. connect to the excel sheet through an ole db conn
2. read the contents in a while loop using the executeReader() method
3. store the values in variables where necessary conversions and validations are performed.
4. call an insert method in the associated dataset tableAdapter that stores these processed values in the sql db.
This is all working as it should. Now I need to check for existing records before I import the values - Ignore completely if the value is found.
According to msdn, I should be able to use my tableAdapters update method by passing a dataSet/Table/Row(s). So this is how I tried to tackle it.
Legend:
lbf = my DataSet
lbf_COKEnCOLE = the Database table associated with lbf DataSet
GetRecordByIdDateLab = runs the following SQL Query on the data
SELECT *
FROM lbf_COKEnCOLE
WHERE (ORIGINATOR_ID = @ORIGINATOR_ID) AND (SMPL_DTE = @SMPL_DTE) AND (LAB_NUM = @LAB_NUM)
(The actual sql refers to all the columns by names instead of using *)
'Code starts here
Dim tableadapter As New lbfTableAdapters.lbf_COKEnCOLETableAdapter
Dim dataTable As lbf.lbf_COKEnCOLEDataTable = Nothing
'check for existing record by using GetRecordByIdDateLab method
dataTable = tableadapter.GetRecordByIdDateLab(ORIGINATOR_ID, SMPL_DTE, LAB_NUM)
If Not dataTable Is Nothing Then
If dataTable.Rows.Count > 0 Then
If Not dataTable(0).ORIGINATOR_ID = Nothing Then
'Row = dataTable(0)
dataTable(0).TURN = TURN
tableadapter.Update(dataTable) '<<THIS IS WHERE IT CRASHES WITH "A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.dll
End If
'The following tableAdapter works perfectly whenever the condition is true (for new entries that is)
ElseIf dataTable.Rows.Count = 0 Then
tableadapter.InsertQuery(counter, ORIGINATOR_ID, SMPL_DTE, LAB_NUM, TURN)
End If
End If
****************************************
More details:
I have DataTable under "Watch" and the value for it shows up as "dataTable has not been declared". This ofcourse is misleading because it is, plus intellisense picks it up where I'm updating the column values by referencing them with dataTable(0).columnName
I have been wondering if
dataTable = tableadapter.GetRecordByIdDateLab(ORIGINATOR_ID, SMPL_DTE, LAB_NUM)
does what its supposed to do, ie. return a dataTable with the matching record. I tried to recieve the data in a row but it only allowed it to be saved in a datatable instantiated in this manner. Furthermore, when I read the values read into the datatable, each column value shows up only as lbf_COKEnCOLE.column (something to this effect) in curly braces. Almost everything else thats returned, like index values and what not that I suppose is used to keep the schema of the table has errors in it.
Any suggestions and help would be greatly appreciated!! I am trying to avoid suddenly using command objects when I'm doing everything else through a data Access layer. lastly, I have read and reread this msdn page
http://msdn.microsoft.com/en-us/library/ms233819(VS.80).aspx
and am trying to do everything as shown here, obviously to no avail
All .net people out there, if you would help this awkward programmer, it would be greatly appreciated! Thanks
~Ghazanfar
|
|
|
|
|
Hi,
I apologize for double post, but this is very urgent, and I don't know how to do it.
I have to create a table with unknown number of rows. There should be a button for adding a new row and a button for deleting selected rows (in each rows there is a cell with a checkbox for deleting). I started with AJAX, but I'm a newbie, so I stuck. I can now add new rows, but have no clue how to delete them. Is there anyone who could help?
Here's my code (for now):
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:table id="receivingInstitutionsTable" runat="server">
</asp:table>
</contenttemplate>
<triggers>
<asp:asyncpostbacktrigger controlid="ButtonAddNewReceivingInstitution" eventname="Click" />
<asp:asyncpostbacktrigger controlid="ButtonDeleteReceivingInstitutions" eventname="Click" />
</triggers>
</asp:updatepanel>
That's my table and two buttons - one for adding new row, and second for deleting selected rows. And this is inline code:
static int numberOfReceivingInstitutions = 1;
ArrayList receivingInstitutionsArrayList = new ArrayList();
protected void Page_PreInit(object sender, EventArgs e)
{
Control controlWhichCausedPostBack = GetPostBackControl(this.Page);
if ((controlWhichCausedPostBack != null))
{
if ((controlWhichCausedPostBack.ClientID.ToString() == "ButtonAddNewReceivingInstitution"))
{
numberOfReceivingInstitutions += 1;
}
}
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
for (int i = 0; i < numberOfReceivingInstitutions; i += 1)
{
TableRow newReceivingInstitution = getNewRow();
newReceivingInstitution.ID = "receivingInstitution" + i.ToString();
receivingInstitutionsTable.Rows.Add(newReceivingInstitution);
receivingInstitutionsArrayList.Add(newReceivingInstitution);
}
}
|
|
|
|
|
Hey, guys.
The web controls typically have a CssClass="yadayada" attribute for formatting via the css style sheet. However, I'm finding it's occasionally difficult to map the declarative attributes of a control to the corresponding elements in the style sheet. GridView is a great example but it's just one of many where a clear one to one mapping is not always obvious.
I'd like to think that this is explicitly documented somewhere and I'm just overlooking it. Does anyone know where in the MDSN docs these attribute to style sheet equivalents are spelled out?
Thanks,
|
|
|
|
|
I don't understand what you are looking for. CssClass just becomes the 'class' attribute of the HTML element produced.
led mike
|
|
|
|
|
I probably didn't word the question very well. Naturally, at the moment I can't find a specific example of areas where this has been a problem. Using GridView for illustration, you have a huge list of attributes, such as AlternatingRowStyle-BackColor, etc. Since you're dealing with a table, some of these relate to header cells, some apply to regular cells, some apply to the table itself, etc., all of which dictates which style elements to tweak in your css file.
Obviously there's no realy mystery with the Label control, but with the more complex grids, menus, etc. I find no documentation that maps, for instance, AlternatingRowStyle-BackColor to the header cell, BorderStyle to, perhaps, the table element, etc. This is the documentation I'm looking for. I recall Googling on GridViews back when I was having a problem with this and found that it wasn't an uncommon experience.
Does that clarify?
|
|
|
|
|
Christopher Duncan wrote: Does that clarify?
Not really. They all go into the output HTML somewhere so all you have to do is set one or more and run it and View Source on the page to see where they went or "mapped to" if that's what you mean.
led mike
|
|
|
|
|
how can i define a error path in my domain to a file like errorpath.aspx
thanks for any help
|
|
|
|
|
Turn on custom errors in web.config and supply file name which you would like to show upon an error.
|
|
|
|
|
in web.config :
<system.web>
<customerrors defaultredirect="errorPage.aspx" mode="on" />
</system.web>
Every road leads to Rome.
|
|
|
|
|
thanks for help, but exactly i wanna change a file not have in my web to a correct file like default.htm
for example: my file have address: http://localhost/myweb/helloworld.aspx
but customer type on their brower is http://localhost/myweb/sdfsdf
the result of this errors is redirect to http://localhost/myweb/helloworld.aspx
i try to use .htaccess with content
<files ~="^.(htaccess|htpasswd)$">
deny from all
ErrorDocument 404 /helloworld.aspx
|
|
|
|
|
hi...
i have a unique problem.
Mywebpage has a login/password authentication..but i am not using windows authentication since the client is not using the active directory.
The webpage has a link "click to download this file" ...on which that particular file is downloaded.
When this new file is opened....the url n the browser id the
"www.sitename.com/foldersin which file is present/filename1.ext".......
if someone knows the other files in this folder one can easily access them tooo...
eg:if i know file2 exists
i can just open another browser and open file2 like this
"www.sitename.com/foldersin which file is present/file2.ext".......
is there a way to stop this????
please reply!
thanks....
|
|
|
|
|
Hello,
Is it possible to detect from my Custome Server Control Code if the Web Application is running under highest trust level or not ? Because I want to use VirtualFile classes which requires trust level to be high but if my user does not have highest trust level then my custom control will do different task.
Would you plase show a snippet or any online article please ?
|
|
|
|
|
|
Great Great Great !! Thanks for the help.
|
|
|
|
|
i want to create sample.aspx page dynamically using c# coding.
Actual requirement is, if i have one page which contains "Generate Page" buttton. When i click on it, it generates a webpage with custom name.
How can i achieve this through code?
G. Satish
|
|
|
|
|
|
what ignore man? have u studied my question? what i have reposted?
It is better to think about the question what i have asked but not the way already some one posted this ...like this..
G. Satish
|
|
|
|
|
why u change the color of my question?
This is not a good way. I am asking different questions always.
Read one or two times before doing this
G. Satish
|
|
|
|
|
Satish - Developer wrote: why u change the color of my question?
A message becomes bright red when it is high-voted or dimmed (grayed) when it is low voted.
On the lighter vein, if you still want to find out who changed the color of your question, I would suggest you the following:
[JOKE]
You ought to ask it to CP Design Team.
[/JOKE]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Satish - Developer wrote: "Generate Page" buttton. When i click on it, it generates a webpage with custom name.
ASPX pages are normal files with markup and necessary page directives. So you can use StreamWriter / FileStream to create a file with ASPX extension. BTW, why you need to do this ?
|
|
|
|
|
why i need means, i need to generate this aspx pages in 1000's for search engine optimization.. some of the content has been changed while creating a page.
G. Satish
|
|
|
|
|
Satish - Developer wrote: i need to generate this aspx pages in 1000's for search engine optimization
Ahh, you are lost totally. Have you ever though about maintaining the pages when something changes ? This is not the right way to go. Try URL rewriting instead.
|
|
|
|
|
Do you want to generate user specific code dynamically and display it on the webpage. With HTML formatting in it??? If I am Right...
in .aspx page (This page is common for all the Customers)
<asp:panel id="Panel1" runat="server" height="250px" width="300px">
<div id="ClientBody" runat="server"></div>
</asp:panel>
in .aspx.cs page
string t = ........; //Pass client specific data here. you can also use HTML taga as u wish for formatting the data. Use stringbuilder if you have...........
ClientBody.InnerHtml = Server.HtmlDecode(t); // to display in .aspx page
~JJ
|
|
|
|