|
Does the session variable pass like a quary string or does the server keep track of the session variable?
Chad Dolan
|
|
|
|
|
A session variable is maintained by the server and is not passed via query string
only two letters away from being an asset
|
|
|
|
|
Hi,
I have a table for users of a system. A datagrid is databound with the table's details. However, there is another table which stores the users' title(Mr/Mrs).
In the user table, it is a foreign key. How can I display Mr/Mrs on my datagrid and NOT a number ID representing the user title?
Any hint would help, Thank you in Advance.
|
|
|
|
|
From database itself you can get the title text with the user details using join in the query.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I think you ay have misunderstood me, or may i be i misunderstood you :S
Let me rephrase.
Currently, in my datagrid, if I add new user to the databse table "User", using the webform, this is what is displayed:
**Title****Firstname****Lastname****Username**
----------------------------------------------
**1****Joe****Blogs****jbloggs**
I want to replace that "1" with "Mr", which can be read from the "Title Table".
I think it may have something to do with views, a friend of mine advised.
-- modified at 10:46 Wednesday 23rd August, 2006
|
|
|
|
|
Hi,
Just make a join with the table which has Mr, Mrs, etc.. with this table like,
Select a.idfield, b.MrMrsfield as title, a.firstname, a.lastname, a.username
from nametable a, mrmrstable b
where a.idfield = b.idfield
and on the grid hide the idfield column, hope it makes sense for your requirement.
Ram
|
|
|
|
|
This makes complete sense.. Thank you for your replies.
There is something I'm missing tho. I will figure it out!
Thanks again.
|
|
|
|
|
I figured out what the problem was!
The BOUND COLUMNS in the datagrid were referring to the ID of Mr/Mrs.
Since I have made a qurey referring to the JOIN in the VIEW of both tables, I was able to point to the DESCRIPTION field of the TITLE table which holds the values Mr/Mrs.
In other words:
(COLUMN) DataField="Description" SortExpression="Description" HeaderText="Title"
(COLUMN) DataField="Forename" SortExpression="Forename" HeaderText="Forename"
(COLUMN) DataField="Surname" SortExpression="Surname" HeaderText="Surname"
(COLUMN) DataField="Username" SortExpression="Username" HeaderText="Username"
which work with the query: select * from VIEW_USER
I hope any who searches for an answer to this will find this post useful!
Thanks again.
|
|
|
|
|
Can anyone tell me what needs to be done to get the enterprise library
(june release) to work with VS 2005. I have changed the paths in the bat
files as reccomended in the following post
http://www.codeproject.com/dotnet/EntLibJune2005_VS2005.asp
and made all the changes but at runtime when calling
FormatData obj = Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationManager.GetConfiguration("FormatSection") as FormatData;
I get the following error,
"Unrecognized attribute 'requirePermission'
(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machin e.config line
14)"
Any help would be appreciated
Praveen
|
|
|
|
|
Did you open the machine.config file and search for requirePermission. Remove that attribute or change it.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
I have got .netframework 1.1 and .netframework 2.0 installed on my machine.
I searched for machine.config for .netframework 2.0 and removed requirePermission attribute from it.
But it did not solve the problem, now it generates following error :
Unrecognized configuration section configProtectedData. (C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 97)
Praveen
|
|
|
|
|
Due to format like below, we are not able to save properly this information in SQL server 2000
Migración Líneas 1&2
Above information is saved as in SQL SERVER 2000
Migración sistema control Abelló Linde Alcalá
Can someone help me in this regard?
Thanks
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
Hi,
I am having problems looping through an array.
I have an arraylist, that has no values to it, once I start a while loop that fills a datareader. Once I get a specific value from a field in the database, I write that value to the arraylist. Once the reader is done, I also want to display the results from the arraylist in a label.
My code:
<br />
dim arrErrors as new Arraylist()<br />
<br />
While (objDr.Read())<br />
objInvoice = New Invoice()<br />
objInvoice.InvoiceDate = objDr(0).ToString<br />
objInvoice.InvoiceNumber = objDr(1).ToString<br />
objInvoice.InvoiceSubHead = objDr(2).ToString<br />
objInvoice.InvoiceTotal = objDr(3).ToString<br />
objInvoice.InvoiceSignoffBy = objDr(4).ToString<br />
objInvoice.InvoiceSubmittedBy = objDr(5).ToString<br />
<br />
<br />
If objInvoice.InvoiceSubmittedBy = "" Then<br />
arrErrors.Add("An error occured retrieving record" & objInvoice.InvoiceNumber)<br />
<br />
Else<br />
<br />
objInvoiceDetails.Add(objInvoice)<br />
End If<br />
<br />
End While<br />
'' I need code here to display the arraylist in an label<br />
<br />
Would really appreciate the help.
|
|
|
|
|
Dim intCount As Integer = 0
Do While intCount < arrErrors.Count
Me.Label1.Text += arrErrors(intCount).ToString
intCount += 1
Loop
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Thanks,
I have one more problem. I do the code in my data access layer. How can I display the arraylist on my aspx page? If I do the following, I still dont see the label with errors...
<br />
'label already in aspx page <br />
Dim lblShowDetails As Label<br />
<br />
Dim intCount As Integer = 0<br />
Do While intCount < arrErrors.Count<br />
lblShowDetails.Text += arrErrors(intCount).ToString<br />
intCount += 1<br />
Loop<br />
|
|
|
|
|
Are you getting any error or simply the data is not being displayed?
Best Regards,
Apurva Kaushal
|
|
|
|
|
No data is being displayed.
I am new to the 3-tier programming method.
Basically my app works as follows:
aspx.vb file
<br />
<br />
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
Dim strSuccess As String = Invoice.SelectInvoiceToAS400()<br />
<br />
If strSuccess = 1 Then<br />
lblSuccess.Text = "Successfully added to DB2"<br />
Else<br />
lblSuccess.text = "Unsuccessful entries"<br />
End If<br />
<br />
End Sub<br />
<br />
business tier
<br />
Public Shared Function SelectInvoiceToAS400() As Integer<br />
Return ExportXLSDA.SelectInvoiceToAS400()<br />
End Function
data access tier (in short)
<br />
Public Shared Function SelectInvoiceToAS400() As Integer<br />
<br />
Dim arrErrors As New ArrayList()<br />
<br />
Dim objInvoice As Invoice = Nothing<br />
<br />
'Create new dataset to hold information<br />
Dim objInvoiceDetails As New List(Of Invoice)()<br />
Dim objConn As SqlConnection = New SqlConnection(ConnectionString())<br />
Dim objCmd As SqlCommand = New SqlCommand("sp_SelectInvoiceDetails", objConn)<br />
<br />
'Mark the command as a TEXT Select<br />
objCmd.CommandType = CommandType.StoredProcedure<br />
<br />
'Open the connection<br />
<br />
objConn.Open()<br />
<br />
Try<br />
Dim objDr As SqlDataReader = objCmd.ExecuteReader()<br />
<br />
dim arrErrors as new Arraylist()<br />
<br />
While (objDr.Read())<br />
objInvoice = New Invoice()<br />
objInvoice.InvoiceDate = objDr(0).ToString<br />
objInvoice.InvoiceNumber = objDr(1).ToString<br />
objInvoice.InvoiceSubHead = objDr(2).ToString<br />
objInvoice.InvoiceTotal = objDr(3).ToString<br />
objInvoice.InvoiceSignoffBy = objDr(4).ToString<br />
objInvoice.InvoiceSubmittedBy = objDr(5).ToString<br />
<br />
<br />
If objInvoice.InvoiceSubmittedBy = "" Then<br />
arrErrors.Add("An error occured retrieving record" & objInvoice.InvoiceNumber)<br />
<br />
Else<br />
<br />
objInvoiceDetails.Add(objInvoice)<br />
End If<br />
<br />
End While<br />
<br />
Catch ex As Exception<br />
<br />
Dim strExceptionMsg As String = "Error Executing GetAS400InvoiceDetails(): " & ex.Message & "\r\n"<br />
Throw New Exception(strExceptionMsg, ex)<br />
<br />
Finally<br />
objConn.Close()<br />
<br />
End Try<br />
<br />
<br />
Dim intCount As Integer = 0<br />
Do While intCount < arrShowDetails.Count<br />
lblShowDetails.Text += arrShowDetails(intCount).ToString<br />
intCount += 1<br />
Loop<br />
<br />
Return 1<br />
<br />
End Function
|
|
|
|
|
You just check whether data is there in the arraylist or not.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Apurva Kaushal wrote: You just check whether data is there in the arraylist or not.
Ok, I am not sure what you mean by your post?
Can you maybe help me on how to return that array from my dataaccess layer to the aspx page?
|
|
|
|
|
You can send the arraylist as an object and then later cast it as per your requirement.
Best Regards,
Apurva Kaushal
|
|
|
|
|
If the lable exists on the page then the code should be
<br />
me.lblShowDetails.Text += arrErrors(intCount).ToString<br />
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
ToddHileHoffer wrote: me.lblShowDetails.Text += arrErrors(intCount).ToString
It would work if the array and label is on the same page, however the label is in my aspx.vb class, and the array in my datalayer. - basic 3 tier application.
|
|
|
|
|
OK, there are two ways you can handle this. Pass either the label object to the datalayer ByRef. Or return a string from the datalayer to your aspx.vb page. What is the problem?
-- modified at 10:50 Wednesday 23rd August, 2006
A thrid way would be to return the arraylist from your datalayer. If you don't know how to pass variables to and from classes you need to go open up a newb programming book. This is basic stuff man.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Hi,
I managed to return the array as a string from my datalayer to aspx page. Thanks for your help.
|
|
|
|
|
Hi
I'm getting a small problem. I've declared an array variable in javascript which is working fine if the script is with the aspx page. But when I'm separating the same javascript code to another file, then an script error occurs at the decalration location.
In the aspx page it was defined like this:
var Arr = new Array();
-------
-----
other functions-----
when transferring it to a separate javascript file say JavasS.js, it was written as the first line:
var Arr = new Array();
And then the other functions.
Previously it was working fine, but now its throwing javascript error at the said line.
What can be the reason and how to solve it?
Please help.
Thanks in advance.
Irshad Ahmad
|
|
|
|