View Complete Post
I am developing a multi-company application and want my users to give the functionality like the following to switch companies.
http://gmailblog.blogspot.com/2010/08/access-two-gmail-accounts-at-once-in.html
Is this possible? then how?
Please help
Thanks
A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the
The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)
error message that would typically be received when the dll has not been added as a reference or added in a using statement.
I can eliminate the error by adding an
<add
Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.
Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.
Hello, I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error: The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.This happens at the following line in global.asax: model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });Please help!Thanks
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });Please help!
Good Day all,
Having an issue with an outside user accessing my IIS7 box. I do not have this problem when running the website from my host machine. I found this post: Http://forums.asp.net/t/1371394.aspx. I assure you that this is not a solution because I am not storing any of my files on a network share.
What do you think my approach should be.
I already have read rights to IIS user to my BIN folder.
Thanks for the help.
Hi.I have the below SQL which works just fine:SELECT Message, CreateDate, AccountId, AlertTypeIdFROM dbo.AlertsUNIONSELECT TOP (100) PERCENT Status, CreateDate, AccountId, (SELECT 10 AS Expr1) AS AlertTypeIdFROM dbo.StatusUpdatesWHERE AccountId = PassedInParameterORDER BY CreateDate DESCI have been going about trying to convert the above into a LINQ method and am having problems with return types. As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates - and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I am using "var" to make the results of "alerts" and "updates" generic before the union. public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId) { using (WorkbookDataContext dc = _conn.GetCont
Hi,
This is frustrating, and I don't know how to solve it.
I have a strange problem. I am adding a LinqDatasource object, and set the context:
protected void LinqDataSource_ContextCreating(object sender, LinqDataSourceContextEventArgs e) { e.ObjectInstance = new KaruselaDataContext(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); }
Then I get this error:The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On web.config I already have this:<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.
is there another way adding a refernce to a web project? or only though teh web.config?
Thanks.
Hello!
I have a problem I can't figure out.
I've been trying to add a listbox with multi select enabled as a parameter to my select statement in sqldatasource.
So i created a function like this :
string strItemTypes = ""; foreach (ListItem li in lbItemType.Items) { if (li.Selected) { strItemTypes += "," + li.Value; } } strItemTypes = strItemTypes.Substring(1);
which gives me the selected items like this for example : "1,2,3"...Then I've been trying to add it to my sql select statement :
SELECT tblOfficesItems.idOfficesItems, tblStockItems.Name, tblStockItems.Description, tblStockItemTypes.TypeItem, tblStockItems.Notes FROM tblOfficesItems INNER JOIN tblStockItems ON tblOfficesItems.fkItem = tblStockItems.idItem INNER JOIN tblStockItemTypes ON tblStockItems.fkTypeItem = tblStockItemTypes.idTypeItem WHERE tblStockItems.fkTypeItem IN ( @fkTypeItems )
using a hiddenfield with a controlparameter of type=objectbut it just don't seem to work, seems like the data just won't bind or something and I don't get any errors so I'm confused!!
then i tried this :
SELECT tblOfficesItems.idOfficesItems, tblStockItems.Name
Im using Enterprise library 5.0I have a scenario, where I have to access two different databases in my application.Basically this application is a webservice,delployed on my local for testing purpose.I'm trying to access this web method from diffent windows application, default connection works fine but the other database throw's exception.Problem is only my defaultDatabase is works fine, if I change defaultDatabase="MYCON1" with "MYCON2" it works fine, if I try to access the other database which is not default, throws exception.<dataConfiguration defaultDatabase="MYCON1" /><connectionStrings><add name="MYCON1" connectionString="Data Source=server1;Initial Catalog=dbName1;User Id=Username1;Password=password1;"providerName="System.Data.SqlClient
I have a user control (ContainerCtrl) which programmatically instantiates another user control (SimpleCtrl) in OnLoad. It builds and runs fine, but when I publish it I get the error "error BC30002: Type 'ASP.SimpleCtrl' is not defined." (If I publish without the "updateable" option there's no error, but I need the site to be updateable.)
I assume this has to do with the particulars of how the assembly(ies) are built for the different compiler options. My question is, how can I get it to work properly for "updateable" publishing?
VS 2008 / .NET 3.5 sp1
The code follows (web.config is the default from Visual Studio).
Many thanks, Dave
SimpleCtrl.aspx------------------------------
<%@ Control Language="VB" ClassName="SimpleCtrl" CodeFile="SimpleCtrl.ascx.vb" Inherits="_SimpleCtrl" %><div> Simple control</div>
SimpleCtrl.aspx.vb------------------------------
Partial Class _SimpleCtrl Inherits UserControl 'Nothing to see here.End Class
ContainerCtrl.aspx------------------------------
<%@ Control Language="VB" CodeFile="ContainerCtrl.ascx.vb" Inherits="_ContainerCtrl"
Can someone tell me why the system does not recognize DirectoryEntry in the code below? It indicates DirectoryEntry cannot be found.
using System; using System.Collections; using System.Collections.Generic; using System.DirectoryServices; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.DirectoryServices.AccountManagement; public partial class MyADGroups : System.Web.UI.Page { public static ArrayList getuserattributes(string objectDn) { DirectoryEntry objRootDSE = new DirectoryEntry("LDAP://" + objectDn); ArrayList props = new ArrayList(); foreach (string strAttrName in objRootDSE.Properties.PropertyNames) { props.Add(strAttrName); } return props; } }
using System; using System.Collections; using System.Collections.Generic; using System.DirectoryServices; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.DirectoryServices.AccountManagement; public partial class MyADGroups : System.Web.UI.Page { public static ArrayList getuserattributes(string objectDn) { DirectoryEntry objRootDSE = new DirectoryEntry("LDAP://" + objectDn); ArrayList props = new ArrayList(); foreach (string strAttrName in objRootDSE.Properties.PropertyNames) { props.Add(strAttrName); } return props; }
}
I am trying to use ReportViewer 9 in Visual Studio 8 but I get this error when I try to run the page:
The base class includes the field 'ReportViewer1', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).
Please help if you can!
1 Partial Class _Default2 Inherits System.Web.UI.Page
3 Public Function Ohjoy(ByVal X As Integer) As Integer4 Dim theClass As New Class1 '= New Class1()5 theClass.ReSize(0)6 theClass.myBaby(0).GetName(0) = "Hello" 'Property Chars is read only'7 Return 18 End FunctionI have a first class named "Class1". I have a second class named "Class2" Class2, is a member of class 1,and is implemented as an array of objects of type Class 2.
If I try and call the Accessor GetName() my hard coded value "Hello" in my accessor is not returned? Onlyan alpha character like "T"
Also if I try and assigne a value using the setter GetName() it does not work, and the compiler gives me an error message "property Chars is ReadOnly? Does anyone know what is wrong in my code? Line 6 above
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Ohjoy(1)End SubEnd Class
Public Class Class1 Dim bs As Integer Public myBaby() As Class2 Public myB As Class2 Public Function ReSize(By
I am doing this .. and i want to convert object array to byte array. How should I do that?
Object[] myVal = um.myData;
Object
Byte[] byteArray = (Byte[])myVal;
Visual Basic 2008 provides type inference to get the language ready to take advantage of LINQ and make your code more robust.
Bill Horst
MSDN Magazine October 2007
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend