|
the connection string should include "Integrated Security=SSPI".
that is
SQLConn = new SqlConnection( " Data Source = .\\SQLEXPRESS;" + " <br />
Initial Catalog = MTDB; Integrated Security=SSPI " );
hope this will help you.
Cheers
Ramesh.Kanjinghat
|
|
|
|
|
but your answer too late , i already did it, any way thanks
|
|
|
|
|
hi all,
ok so I have a formview thats bound to an objectsource.
within the formview, I have a listbox that I added myself.
<asp:listbox id="ListBoxObjective" runat="Server">
<asp:listitem>Item 1
<asp:listitem>Item 2
<asp:listitem>Item 3
how do I set the right value selected within this lisbox? all other
values on textboxes is being set with
Text='<%# Bind("objective") %>
but it wont allow me to put this binding on listitems.
any ideas?
thx
M
|
|
|
|
|
Hi there,
You can bind the value to the SelectedValue property of the ListBox control instead of the Text property of the ListItem.
|
|
|
|
|
Hi
I’m new to ASP and I have a problem Passing parameter to a report. I tried to pass an integer parameter to a crystal Report on a web from. So I wrote the following code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ParameterFields As CrystalDecisions.Shared.ParameterFields
Dim ParameterField As CrystalDecisions.Shared.ParameterField
Dim ParameterValue As CrystalDecisions.Shared.ParameterDiscreteValue
Dim DepID As Integer
DepID = 8
ParameterFields = New CrystalDecisions.Shared.ParameterFields
ParameterField = New CrystalDecisions.Shared.ParameterField
ParameterField.ParameterFieldName = "@DepID"
PArameterValue = New CrystalDecisions.Shared.ParameterDiscreteValue
ParameterValue.Value = DepID.ToString
ParameterField.CurrentValues.Add(ParameterValue)
ParameterFields.Add(ParameterField)
CrystalReportViewer1.ParameterFieldInfo = ParameterFields
Dim MyRep As New CrystalReport1
CrystalReportViewer1.ReportSource = MyRep
CrystalReportViewer1.RefreshReport()
End Sub
But It did not worked and I receive the following error:
Missing parameter field current value.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: CrystalDecisions.CrystalReports.Engine.ParameterFieldCurrentValueException: Missing parameter field current value.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ParameterFieldCurrentValueException: Missing parameter field current value.]
. F(String , EngineExceptionErrorID
) +574
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalSetReportInfo(RequestContext reqContext) +1293
CrystalDecisions.CrystalReports.Engine.FormatEngine.internalGetViewContext(ReportPageRequestContext reqContext, * viewContext) +217
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +280
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.u(Boolean N) +164
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489
Can anyone help me??
Thanks in advance
AVA
|
|
|
|
|
Hi all,
I have a problem with WebService & WSE 3.0
When I create a web service and create a application to use my web service.
Afterward I use WSE Setting Tool to secure both my web service and application with Certificate mode (mutualCertificate11Security).
But when I start my application to call a service, this error appear:
The ex.Message as follow:
"WSE910: An error happened during the processing of a response message, and you can find the error in the inner exception. You can also find the response message in the Response property".
The Response.Fault as follow:
"System.Web.Services.Protocols.SoapHeaderException: SOAP header Security was not understood."
The InnerException as follow:
"Security requirements are not satisfied because the security header is not present in the incoming message."
Please help me solve this problem,
Thank you for you help!
Hung.
Hung
|
|
|
|
|
Hi
I have upload an ASP.net on Apachi Server. I often get the Error like
Invalid Viewstate Cleint IP X.X.X.X Disconnected.
I got a link on MSDN about this errors but can't understand how to solve this problem.
Please help me out of this problem.
Thanks in advance
Lets work it Out.........!
|
|
|
|
|
So I created a custom control.
I right click the toolbox, chose Add and it added my newly made custom control. That workd and its name appears fine on the toolbox.
So I drag the control on the form.
it produced this register tag
<%@ Register Assembly="WebControls" Namespace="ForumWebControls" TagPrefix="cc1"%>
and this html
<cc1:ForumControl runat="server"></cc1:ForumControl>
But it says the following error.
Error 11 Unknown server tag 'cc1:ForumControl'.
Error 11 Element 'ForumControl' is not a known element. This can occur if there is a compilation error in the Web site.
Does someone know something I did wrong? Do I need to register the schema or something? This works in VS2003, why not VS2005?
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Nevermind. I added it to my web.config and it works now
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I wasn't sure where to put this question, but I think the issue is based on what happens after I've queried the database, and what an ASP.net control is doing with the data.
I have a SqlDataSource linked to a Details View. It queries the DB (via a proc) to retreive a bunch of data about a specific record.
I'm having trouble with it, though. Sometimes certain values will return null. The proc left-joins several tables, and sometimes there won't be any results from the joined table (the "left" table is member information. The right table is image information, if there is a picture associated with that member).
I'm getting a Format Exception here (we're in the middle of an edit operation):
<br />
DataRowView rowView = (DataRowView)dvMember.DataItem;<br />
<br />
if (rowView["ImageID"] != null || rowView["ImageID"] != System.DBNull.Value)<br />
imageID = Int64.Parse(rowView.Row["ImageID"].ToString());<br />
Actual error message:
"System.FormatException: Input string was not in a correct format"
if the member in question has no image (this will be used for determining what I need to do for the rest of my updating). I don't know what I need to check for here. I thought null or DBNull would handle it. No dice. So what happens when you pull information from the DB into a datasource? What does it do to null values? Or is my DetailsView doing something to them (tricksome, they can be). I can't seem to find this information anywhere, and my good ADO books are all at home.
|
|
|
|
|
Hi there,
IMO, the simple way to figure out the root cause is to debug your application and have a look at the rowView.Row["ImageID"] , then you can see what is the real value of it. Btw, when do you want to run the posted sample code? Does it run when you select data to the DetailsView control or when you update data?
|
|
|
|
|
I Forgot to mention that, sorry. The watch window is showing that rowView.Row["ImageID"] is null. This is contributing to my bafflement.
What happens on the page is this: user enters a search term in a text box, his search button. A Grid View is populated with matches for that search term. Basic information - name & email - is shown. There's a "view details" link button that makes dvMember visible when clicked, and populates dvMember with all of the individual information about that specific user (and we're doing all the retreival and binding right there). There's a datasource binding dvMember to gvMember & the selected index property (iirc, I'll double check at work monday).
In hindsight, I wouldn't use a second datasource there - part of the goal on this project for me was try and get comfortable with the controls. Since updates and deletes here are multi-table, I think the datasource is just in the way for the most part.
|
|
|
|
|
+ A quick fix is to replace the or (||) operator in the if condition with the and (&&) operator.
grandypeace wrote: There's a datasource binding dvMember to gvMember & the selected index property (iirc, I'll double check at work monday).
Yes, it should be the way you go.
grandypeace wrote: Since updates and deletes here are multi-table, I think the datasource is just in the way for the most part.
Because it's related to multiple tables, you may consider using the ObjectDataSource control.
|
|
|
|
|
minhpc_bk wrote: + A quick fix is to replace the or (||) operator in the if condition with the and (&&) operator.
Ugh, that's a stupid one to get myself into.
minhpc_bk wrote: Because it's related to multiple tables, you may consider using the ObjectDataSource control.
Well, I think if I was doing it all over again I'd probably do that. This is a small project - and it seemed to me at the start that doing actual objects would be a waste of time. Of course, once I got through most of it I had an additional requirement dropped on me - I had to map some of the data into a database in another application (so my multi-table operations became multi-table, multi-DB). I would have saved myself some trouble had I started differently. Live and learn.
|
|
|
|
|
|
This is what i tried:
<asp:HyperLinkColumn Text="View Details" ItemStyle-CssClass="table_text"></asp:HyperLinkColumn>
|
|
|
|
|
Hi
I am creating checkboxes dynamically. I want to catch the even when a checkbox is checked.
How can I do this. I know I need to create a method:
CheckBox1_CheckedChanged(object sender, System.EventArgs e)
But how do I attach this method to all the checkboxes I create dynamically. I cannot use OnCheckedChanged="CheckBox1_CheckedChanged"> as I am adding the checkbox dynamically.
thanks
|
|
|
|
|
The general format for programmatically assigning an event handler to a control in C# is:
ControlName.Event += new Delegate_Type(Name_Of_Procedure)
So given the CheckedChanged event of a checkbox requires an event handler of the delegate type System.EventHandler , you can use the following:
CheckBox1.CheckedChanged += new System.EventHandler(CheckBox1_CheckedChanged);
|
|
|
|
|
I know that it's possible to mix ASP & ASP.NET 1.1 in the same
website/application so long as they are in separate frames (iframes). This
also holds for mixing ASP & ASP.NET 2.0 pages. But what I haven't tried
is mixing ASP.NET 1.1 & ASP.NET 2.0 pages in the same website/application
but each page in different iframes.
I don't think it's possible to to have both ASP.NET 1.1 & 2.0 pages in
the same website since IIS defines which ASP.NET version to use. Does
anyone know a way to make IIS use ASP.NET 1.1 for certain pages, and
ASP.NET 2.0 for other pages?
Probably one can host the ASP.NET 1.1 website, and link in the iframes
of ASP.NET 2.0 pages from another website in the same IIS server. But
that's just looks clumsy.
|
|
|
|
|
Hi there,
You can configure some web pages in your ASP.NET 1.1 application to run under the .NET 2.0. You can follow the steps as below:
+ Move the web pages which you want to run with the ASP.NET 2.0 into a subfolder, say A.
+ In the IIS snap-in, right click A to open the Properties window.
+ In the Directory tab, click Create in the Application Settings section.
+ Switch to the ASP.NET tab, you now can see that the ASP.NET version dropdownlist is editable, and you can select the version 2.0 for the A, and click Apply.
+ You then can go back to the Directory tab, to click the Remove button, this step is optional as you also simply leave it as it is.
+ You finally click OK to close the Properties window and do your testing.
However, you should remember that the ASP.NET 2.0 supports 100% backward compatibility, so you can simply configure your application to run with the ASP.NET 2.0 and your old web pages still work properly.
|
|
|
|
|
I have a GridView defined as
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" Width="100%" BorderStyle="None" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnRowCommand="GridView1_RowCommand" DataKeyNames="ID"><br />
>
and my template field is defined as
<asp:TemplateField HeaderText="Message Subject" ShowHeader="true" >
<ItemTemplate>
<asp:LinkButton ID="LinkTo" runat="server" CommandName="Select" CommandArgument='<%#Eval("ID") %>' Text='<%#Eval("Subject") %>' PostBackUrl="~/ViewPost.aspx"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
and my RowCommand is defined as in code
<br />
public void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)<br />
{<br />
if (e.CommandName == "GetEntries")<br />
{<br />
int i = 0;<br />
}<br />
}<br />
The problem is that the RowCommand never gets hit. The RowCreated does, but not the row command.
Anyone know why its not being hit?
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Hi Nick. I noticed that your comparison is for a commandName of "GetEntries", but your LinkButton includes a commandName of "Select". Is it that simple?
|
|
|
|
|
yeah. I put a breakpoint on the if statement so I'm just trying to get there.
But, yeah it would be wrong.
thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
For anyone who cares or does a search to find this:
If you have the SelectedIndex changed wired. Which is kinda default to you double click. Delete it.
Then the grid will hit the RowCommand
It hints this in MSDN, but not fully.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I need to use response.redirect to a Word document that open with Word (Not IE prowser). When I type the "\\sitename\wwwroot\appfolder\file.doc" in IE address box, the document will be opened with Word. But when I use Response.Redirect("\\sitename\wwwroot\appfolder\file.doc") in my code the address in IE browser becomes to "href="http://siteurl/sitename/wwwroot/appfolder/file.doc" and get "the page can not be fount" error. How can fix the problem?
|
|
|
|