|
Why cant u write a query like this
string strcmd="select * from emp table where status='active';
DataAdapter da = new DataAdapter(strcmd,con);
DataSet ds = new DataSet()
da.fill(ds,"emp");
ddl.DataSource=ds;
ddl.DataTextField=ds.Tables[0].["ur columnname"];
ddl.DataValueField=ds.Tables[0].["ur columnname"];
So that ur ddl will bind only active employees.
|
|
|
|
|
I have an ASP.NET (C#) website that works perfectly on my local system. When I upload it to my web host it used to work fine, however after some updates i re-uploaded it and got an error 'XML Parsing Error: no element found' (in Firefox only, IE displays a blank screen). The update I did was rather large so I really have no idea where to start, it would be almost as quick to start the website again (it is still in the making). Does anyone have a hint of an idea what to do? =]. I realise I haven't given much information here but I dont know what is causing this error so I don't know what to give. Some general information: using masterpages, each page is inheriting from a single class which in turn inherits from System.Web.UI.Page, every file is using codebehind and I am using an MS Access database.
Here is the URL: http://www.maximusbrood.com/sc/
Any help is much appreciated. Thanks.
FinnG -
|
|
|
|
|
You didn't mentioned about where you are getting that error i mean in STARTUP page or any other.
If startup page
-Make sure that there are no errors in web.config file
-If you are using xml file(loading) in Master page make sure that xml file is well formed.
-If you are using Resource File make sure that it is well formed.
Final Suggestion is you can debug in master page by catching that error line.
|
|
|
|
|
Hello,
I have two tables in an Access database: content and content_localized which are related.
I created a query:
SELECT content_localized.content_html
FROM content INNER JOIN content_localized ON content.content_id = content_localized.content_id
WHERE (((content.content_page)=[@Page]) AND ((content.content_name)=[@Name]) AND ((content_localized.content_culture)=[@Culture]));
I tested it in Microsoft Access and it is working fine.
Then I tried to retrieve its value from my web site but nothing shows up.
I am using the following code:
' Set Connection
Dim connectionString As String = ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString
Dim connection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
' Set Command
Dim command As New System.Data.OleDb.OleDbCommand
command.CommandText = "content_SELECT"
command.Connection = connection
command.CommandType = CommandType.StoredProcedure
' Add Parameters
command.Parameters.Add(New OleDb.OleDbParameter("@Culture", _Culture))
command.Parameters.Add(New OleDb.OleDbParameter("@Page", _Page))
command.Parameters.Add(New OleDb.OleDbParameter("@Name", _Name))
' Execute the Command
connection.Open()
Dim contentHtml As OleDb.OleDbDataReader = command.ExecuteReader
If contentHtml.Read Then
Return contentHtml.Item("content_html").ToString()
Else
Return "Error" ***
End If
contentHtml.Close()
connection.Close()
My function returns "Error" from line ***
Does anyone has an idea what might be wrong?
Thank You,
Miguel
|
|
|
|
|
Please share exact error, then may be i can help you. In the meantime
try to change If contentHtml.Read Then to "While contentHtml.Read"
Thanks
|
|
|
|
|
Hello Amit,
That is the point. I don't get any error.
Well, at least I am not seing it.
I also tried with "While..." and I get no returned value.
I tested the query, in Microsoft Access, with the parameters values which I show here and I get one result. However, my function doesn't return anything with those values.
The code I have now is as follows:
Public Function Load()
' Set Connection
Dim connectionString As String = ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString
Dim connection As New System.Data.OleDb.OleDbConnection(connectionString)
' Set Command
Dim command As New System.Data.OleDb.OleDbCommand
With command
.CommandText = "EXECUTE content_SELECT"
.Connection = connection
.CommandType = CommandType.Text
End With
' Add Parameters
With command.Parameters
.Add(New OleDb.OleDbParameter("[@Culture]", "pt-PT"))
.Add(New OleDb.OleDbParameter("[@Page]", "Default.aspx"))
.Add(New OleDb.OleDbParameter("[@Name]", "Newsletter"))
End With
' Execute the Command
connection.Open()
Dim contentHtml As OleDb.OleDbDataReader = command.ExecuteReader
If contentHtml.Read Then
Return contentHtml.Item("content_html").ToString()
Else
Return "Not Found"
End If
contentHtml.Close()
connection.Close()
End Function
Any idea of might be going on or a way to try to figure this out?
Thanks,
Miguel
|
|
|
|
|
I am needing to create WebParts for SharePoint Services using VS 2005 Pro. I currently do not have Microsoft.SharePoint.dll on my PC as I am running XP and not server 2003.
My first question is: Is it possible to create webparts for sharepoint services using VS 2005 Pro because all the articles i could find were mentioning using Microsoft.SharePoint.dll with VS 2003.
Secondly, can I create user control (.ascx) and use it in SharePoint Servics?
Any help will be appreciated. Thanks.
|
|
|
|
|
hello
someone can help me
someone know article that help me to make a good data access layer use data access application block
i know how encapsulation this part is very important i wish to learn how encapsulation
encapsulating common functionality so i will reduce the number of lines of code in me DAL
thanks for the time
|
|
|
|
|
|
thank i will be check the article
|
|
|
|
|
I know dynamic HTML is when we create html on fly. Can I say I know DHTML if I am doing some operation in code behind file where I am building some string as below
In Code Behind page
Dim a as string
a= DataSet.Table(0).row + “<Br>” + DataSet.Table(1).row + “<a href=amit.aspx>”
return a
In Html Page
<%=a%>
Please ignore syntax. As I am just trying to understand what terminology is used for above type of operation i.e where i am mixing html and server code?
Amit
Amit
|
|
|
|
|
Amit Kumar G wrote: I know dynamic HTML is when we create html on fly.
No, it's not. DHTML is basically using client scripts (e.g. Javascript) with HTML.
What you are doing is creating HTML code dynamically. That doesn't make the HTML code dynamic.
---
b { font-weight: normal; }
|
|
|
|
|
can you give me some real time example of DHTML.....it would be gr8 help to understand.
Amit
|
|
|
|
|
Typically DHTML is used to make things happen when the user interacts with the web page. Example:
<span onmouseover="this.style.color='#999';" onmouseout="this.style.color='';">Point here</span>
---
b { font-weight: normal; }
|
|
|
|
|
hi
i have 3 textbox in my webform (email,subject,description) and i use sqldatasource and asp.net 2.0 and c# .
how to insert textboxs.text values into my table (comments) with sqldatasource ?
and how to (update,delete) also ??
Please give me a full description with example because i am beginner .
thanks.
|
|
|
|
|
Hi,
Hope this article will help you.
[^]
Happy Coding
With Regards
Satips
|
|
|
|
|
Hello,
I downloaded the 3rd party program called Scriptx. It is a program that allows control over printing out of a browser. I need this in order to remove the header and footer on IE. My only issue is that the help documents dont really show me how i am suppose to use this program.
Has anyone had experience using this and can you show me how you used it in C#?
Thanks
Steve-o H.
There are 10 kinds of people in this world... Those who understand binary and those who dont.
|
|
|
|
|
Sir,
What are Secured Socket Layers .I want to implement it in the project.(an online project).
Please help.
Thanks
|
|
|
|
|
|
Can i get a code project linkin vb.net with asp.net that uses the Secure Sockets Layer (SSL)?
|
|
|
|
|
Hi All,
Iam facing problem with passing query string to page from javascript ,
for some times it was returning null value eventhough assigning the query string form javascript.
Any Help is appreciated.
Many Thanks,
Vijaya
vijaya
|
|
|
|
|
Can i see the input string .I mean ur query string.
|
|
|
|
|
Then you are most likely doing it wrong.
If you show some code it might be possible to say something of what you might be doing wrong.
---
b { font-weight: normal; }
|
|
|
|
|
Hi there,
I Am writing the security for my site based around Active Directory using ASP .NET 2.0 and the membership class. I have it all working and the configuration too to link to AD and add users etc... the only problem is that I have to validate using the URI and not cookies... no matter what I do a cookie is not created and creates a constant loop of the login page. If I change the cookieless property to 'URI' as opposed to 'UseCookies' in the membership - providers - add section of the web.config then it works fine but the authorisation key is in the URI of the browser I am using.
Could anyone throw any light on why this is causing me a problem? If I use the Page.Request.Browser.Cookies method to see if the browser supports cookies it returns true.
Thanks,
Adam Smith
|
|
|
|
|
How to Validate a login form using asp.net?
|
|
|
|