One way would be to load the assemblies using Reflection. That way, if an assembly changes periodically, you will get the latest
John Gathogo
Posts
-
Replace assembly at runtime -
Getting InvalidCastException using VS2005 TableAdapter generator to call a stored procedureThe return type for CountUniqueBirthdays may not be long (or long? for that matter). Have you tried [int]? Or just receive it into an [object] variable and use Watch to see what it contains? i.e.
object value = adapter.CountUniqueBirthdays(leadID);
-
Retrieve Value from TextBox Which is created in the code behindYou add the textbox using
Controls.Add()
. When creating the textbox from codebehind, you can assign it an ID say, tbDynamicId.TextBox tb = new TextBox();
tb.ID = "tbDynamicId";
this.Controls.Add(tb); //To add the the current formThen you can get the textbox like:
TextBox tbDynamic = (TextBox)FindControl("tbDynamicId");
And then retrive the value normally,
String value = tbDynamic.Text;
-
Reading PDF data from Byte StreamYou can convert a byte array to a string using: System.Text.Encoding.Unicode.GetString([byteArray]); Note: Unicode is just one of the encodings. You can use ASCII, UTF8, etc
-
Unable to Use Net TCp BindingCould it be because you are missing the mexHttpBinding? <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
-
parameter with the In functionI guess your parameter might be comprising of a delimited string, say, "1,2,4,8" or even "{Guid1},{Guid2},...". If such is your requirement, you can always use some little tweaks. Like Declare a temporary table to store the Ids, like declare @Ids table(Id int) Then, use some string functions to split the string and insert the ids into the table. (Like, CHARINDEX, SUBSTRING, etc) After that, you can then use the temporary table on your WHERE ... IN ... clause Like select * from tbl_Name where id in (select Id from @Ids)
-
Primary Key in SQL Server Table VariableIs there any benefit in setting a primary key in a table variable? Especially if you will perform SELECT and INSERT operations on it? Like,
DECLARE @Tbl TABLE(Id INT PRIMARY KEY, Name NVARCHAR(36))
-
ROW_NUMBER ConversionHi Guys, Am trying to LINQ the following statement: Please, if you can help out, please do.
SELECT
ROW_NUMBER() OVER (ORDER BY LastName, FirstName) AS RowNumber,
*
FROM
dbo.Customers
ORDER BY
CustomerID -
Compiled LINQ QueriesLets start here. I have the following two classes:
public class Order { public Int32 Id { get; set; } public String OrderNumber { get; set; } public DateTime OrderDate { get; set; } public String OrderStatus { get; set; } public Int32 CustomerId { get; set; } public List<OrderItem> Items { get; set; } public Decimal Total { get; set; } } public class OrderItem { public Int32 OrderId { get; set; } public Int32 OrderLineNumber { get; set; } public Int32 ItemId { get; set; } public Double OrderQty { get; set; } public Decimal Price { get; set; } public Decimal LineTotal { get; set; } }
Here is some LINQ query that am using to fetch Orders from two database tables (OrderMaster and OrderDetail) and return a List<Order>. The LINQ DataContext that has the two tables is named TempContext.
static List<Order> GetOrders() { using (var context = new TempContext()) { return (from om in context.OrderMasters select new Order { Id = om.OrderID, OrderNumber = om.OrderNumber, OrderDate = om.OrderDate, OrderStatus = om.OrderStatus, CustomerId = om.CustomerID, Total = om.Total, Items = (from od in context.OrderDetails.Where(d => d.OrderID == om.OrderID) select new OrderItem { OrderLineNumber = od.OrderLineNumber, OrderId = od.OrderID, ItemId = od.ItemID, OrderQty = od.OrderQty, Price = od.Price, LineTotal = od.Total }).ToList() }).ToList(); } }
My idea is to convert this LINQ Query to a Compiled LINQ Query and see whether I will be able to get any notable improvements on execution performance. Here is what I was able to
-
Use variable from the code behindWhat about
InsertCommand="INSERT INTO table (column1, column2) VALUES (value1, '" + UserID + "')"
Assuming that you are doing this from within RadGrid1_PreRender routine.
-
web.config file related issueI see that you are using InProc to store state. The following will suffice in this case:
<sessionState mode="Inproc" cookieless="false" timeout="20"/>
You do not need the tcpip attribute -
Interface member's attributesSorry for the misunderstanding Mr. Candyman. Am not exactly sure whether you have to still implement the attribute too.
-
Interface member's attributesYou will also need to implement the properties when implementing the interfaces like:
protected string m\_PropertyName; public string PropertyName { get { return m\_PropertyName; } internal set { m\_PropertyName = value; } }
So, it is expected that you will implement the get and set in derived classes
-
to get all services in the machineDepending on what you mean by "get", Typing "net start" on your command prompt will list for you the services running on your computer. For programmatic access you can use ServiceController class after importing the corresponding namespace.
-
System.Convert.ToDouble(stringVal)No difference actually. System is almost always automatically added in "using" section.
-
check box in grid viewYou most probably, you should create an event that updates the datasource for the GridView (particularly the field that is updated with the checkmark value) when you check mark your checkbox. Otherwise, it is not like the other pages exist. They are generated as you move from one page to the next - on demand.
-
web.config file related issueThe thing is, for a typical application, you dont need to bother with this tcpip. Just let it be. Unless you are sure that based on what you are doing, this tcpip value needs to be changed. You could perhaps give some details.
-
need to Develope web app..?Search for resources on web application development here
-
First web service on ASP.NetJust right-click on the project (Web Application) from Solution Explorer, click on Add Web Reference. You will get a dialog box. Under a label: [Browse to:] click [Web services in this solution]. VS will discover all the web services in your solution and they will be presented in a list. Click on the one you want to use and, after giving it an appropriate web reference name add it (VS might suggest something like 'localhost'). You will then be ready to go. You can add the sample code on the Page_Load of a web form in your web application.
-
First web service on ASP.NetI had a look at the link you quoted. The console application is the client. It should work. Make sure that your console project is the start up project. Right click on the project from Solution Explorer and click "Set as Startup Project".