|
Can Any One expain the dis advantaged of LINQ,like where i Can use and where I can not...
Thanks,
Srinivas Mateti
|
|
|
|
|
Disadvantages of LINQ over Stored Procedures
-----------------------------------------------
1) Network traffic: sprocs need only serialize sproc-name and argument data over the wire while LINQ sends the entire query. This can get really bad if the queries are very complex. However, LINQ's abstraction allows Microsoft to improve this over time.
2) Less flexible: Sprocs can take full advantage of a database's featureset. LINQ tends to be more generic in it's support. This is common in any kind of language abstraction (e.g. C# vs assembler).
3) Recompiling: If you need to make changes to the way you do data access, you need to recompile, version, and redeploy your assembly. Sprocs can sometimes allow a DBA to tune the data access routine without a need to redeploy anything.
|
|
|
|
|
S.Dhanasekaran wrote: Disadvantages of LINQ over Stored Procedures
How a comparison is possible between LINQ and Stored Procedures?
|
|
|
|
|
sris 426 wrote: Can Any One expain the dis advantaged of LINQ
In ASP.Net Forum?
I would have chosen LINQ [^]forum forum for that
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I dont want my Data Layer to Contain SQL Manupilation. Linq does that. I like Linq to Object. Am not a Fan of Linq to SQL
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
What About LINQ to XML and other options? I am using linq to load and process XML file? Will it give any extra burden to Application. Please advise.....
Thanks in advance
Srinivas Mateti
|
|
|
|
|
Anyhow, you are somewhat comparing apples and oranges. LINQ to XML (and LINQ in general) is a query language whereas XSLT is a programming language to transform XML tree structures. These are different concepts. You would use a query language whenever you want to extract a certain specific piece of information from a data source to do whatever you need to do with it (be it to set fields in a C# object). A transformation, in contrast, would be useful to convert one XML representation of your data into another XML representation.
So if your aim is to create C# objects from XML, you probably don't want to use XSLT but any of the other technologies offered by the .NET Framework to process XML data: the old XmlDocument, XmlReader, XPathDocument, XmlSerializer or XDocument. Each has it's special advantages and disadvantages, depending on input size, input complexity, desired output etc.
|
|
|
|
|
Vuyiswa Maseko wrote: I dont want my Data Layer to Contain SQL Manupilation.
So what does your data layer contain?
only two letters away from being an asset
|
|
|
|
|
In my Data Layer i call the SP that does the Necessary manupilation. What i mean is that you will never Find select statements in my Data Layer.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hello!
I'm kinda new to ASP.net so i am just testing and failing, so maybe the approach i am going for is just wrong if so tell me =)
I'm trying to print a sequence of HTML code with Response.Write ... works fine enough, but i am interested in printing this code at a specific point on the page...
Currently i am trying to do that from the class with the method Page_Load, with the event of a button click...
Don't know if that explain it..
|
|
|
|
|
Thekaninos wrote: but i am interested in printing this code at a specific point on the page...
Put a literal control on the area where you need it to be printed. Set the HTML code to literal's Text property.
|
|
|
|
|
Hello
I am developing one web application.I want to use language options for this application.
I have gone through resource files but i didn't get one point which is
how to add values into different language means i add string as Name how to
convert name into French language into value.and My full site has 50 pages how to convert each and every page string values through resource file.
Pls explain me in details if u know this point.
Thanks.
|
|
|
|
|
|
Hi all,
I have one doubt, i am fetching data from database and i am displaying data in gridview.(select empid,empno,covert(varchar,dateofbith,101),convert(varchar,joiningdate,101) from emptable) (values are:1,12,'12/31/1986','12/31/2008')
i am not using any boundfields in gridview.
i am using this code to sort the gridview columns,everything is working fine but dateofbirth,joiningdate fields sorting is not working .
i am using below code to sort the gridview columns:
If Not (Page.IsPostBack) Then
ViewState("Sort") = "asc"
end if
and
Protected Sub grdCommon_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles grdCommon.Sorting
Try
grdCommon.DataSource = Session("grdCommon")
grdCommon.DataBind()
Dim dataTable As DataTable = CType(grdCommon.DataSource, DataTable) ' DirectCast(ViewState("grdCommon.DataSource"), DataTable)
Dim dataView As DataView = New DataView(dataTable)
If Not (dataView Is Nothing) Then
If ViewState("Sort").ToString() = " asc" Then
ViewState("Sort") = " desc"
Else
ViewState("Sort") = " asc"
End If
dataView.Sort = e.SortExpression + ViewState("Sort").ToString()
grdCommon.DataSource = dataView
ViewState("grdCommon.DataSource") = dataView.Table
grdCommon.DataBind()
End If
end sub
Regards
Rama
samrama
|
|
|
|
|
hi,
Here i add a sample code for sorting
1) In Gridview Properties add this
AllowSorting="true" OnSorting="gridView1_OnSorting"
2) In gridView use TemplateField Column
<asp:TemplateField HeaderText="joiningdate" HeaderStyle-HorizontalAlign="Left" SortExpression="joiningdate" ItemStyle-Width="30%">
<ItemTemplate >
<span id="joiningdate" runat="server" style="color:Black;" ><%#Eval("joiningdate") %></span>
</ItemTemplate>
</asp:TemplateField>
3) create a Event gridView1_Onsorting
protected void gridView1_OnSorting(object sender, GridViewSortEventArgs e)
{
string sortExpression = e.SortExpression;
ViewState["sortExpression"] = e.SortExpression;
if (GridViewSortDirection == SortDirection.Ascending)
{
GridViewSortDirection = SortDirection.Descending;
SortGridView(sortExpression, "DESC");
}
else
{
GridViewSortDirection = SortDirection.Ascending;
SortGridView(sortExpression, "ASC");
}
}
4) Create a SortGridView() Method
private void SortGridView(string sortExpression, string direction)
{
DataTable dt = null;
dt = "test" // fill the Datatable rows using sqlcommand or Dataset
DataView dv = new DataView(dt);
dv.Sort = sortExpression + " " + direction;
gridView1.DataSource = dv;
gridView1.DataBind();
}
5) Create a enum SortDirection
public SortDirection GridViewSortDirection
{
get
{
if (ViewState["sortDirection"] == null)
ViewState["sortDirection"] = SortDirection.Ascending;
return (SortDirection)ViewState["sortDirection"];
}
set { ViewState["sortDirection"] = value; }
}
|
|
|
|
|
Hi,
How to save data from a html table to database.
eg: my html table, it is dynamically generated using string concadination
name age address city
N1 10 xyz abc
N2 20 abc xyz
I need to read this html table and save it to database
How to do this?
Thankyou
YPKI
|
|
|
|
|
Say you paste the html into a container div. Now you can get the inner HTML in the server side of the div. Now parse the table from it.
Otherwise if you like to create the entire htmlTable with view state and all, you need to create the object during pre_Init.
|
|
|
|
|
This is the chat box where every second gets refresh with AJAX. But,here the dataset (ds) is filled by other order detail, lead to get wrong messages in the chat box.
How to fill ds for every second from SQL database without conflict?
VB Code
lsSQL = "select MSG_Message from tbl_message where MSG_Orderno='" & orderno & "' order by MSG_ID"
Dim DtSqlAdp6 As New SqlClient.SqlDataAdapter(lsSQL, DbCon)
DtSqlAdp6.Fill(ds)
|
|
|
|
|
Good Day j_u_sankar
There is Probably a better way of doing this, but anyway. To Clear the dataset you must Add the Following code
DtSqlAdp6.Clear()
before you fill the dataset.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Dear Experts,
i've designed a crystal report and embedded a sub report in it, the sub report needs to display some 7 records (i.e 7 lines), the design goes this way
i've few detail sections then the sub report is inserted in a detail section followed by few detail sections, the issue here is when i check preview the report detail sections are displayed perfectly when comes to question of sub report its display 2 records repeatedly for pages together(approx 5 pages) and at the 5th page its dispalying all the records perfectly, later the same pages are repeated again.
i'm using the same stored procedure in both the main and sub report.
if some one has come across this sort of issue plz let me know how to overcome, i will be happy to explain you the problem in detail if some one is interested.
Thanks in advance
Murali..
|
|
|
|
|
hii...
all.I m using asp.net 3.5.I have a feedback form.On the click of button i want to send mail.how can i do this.
can anybody send me a gud link which is self explanatory.
thanks....
|
|
|
|
|
|
|
i have just did a copy and Paste from my old Function that does that when ever there is an Erro on my applicatin
private void Send_log()
{
String Client_Domain = System.Environment.MachineName.ToString();
Exception objErr = Server.GetLastError();
String FromE = ConfigurationManager.AppSettings.Get("FromE");
String To_1 = ConfigurationManager.AppSettings.Get("EmailTO1");
String To_2 = ConfigurationManager.AppSettings.Get("EmailTO2");
String Gmail_Password = ConfigurationManager.AppSettings.Get("Gmail_Password");
String Networked_Username = ConfigurationManager.AppSettings.Get("Networked_Username");
int Gmailport = Convert.ToInt32(ConfigurationManager.AppSettings.Get("Gmailport"));
String Server_Host = Convert.ToString(ConfigurationManager.AppSettings.Get("GmailHost"));
String Body = Convert.ToString(Application["testError"]);
System.Environment.UserDomainName.ToString();
try
{
if (Body != "")
{
MailMessage mm = new MailMessage();
SmtpClient smtp = new SmtpClient();
mm.From = new MailAddress(FromE);
mm.To.Add(new MailAddress(To_1));
mm.To.Add(new MailAddress(To_2));
mm.Subject = "Exception Report from " + Client_Domain + "In EXAM/CLASS";
mm.Body = Body;
mm.IsBodyHtml = true;
smtp.Host = Server_Host;
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = Networked_Username;
NetworkCred.Password = Gmail_Password;
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = Gmailport;
smtp.Send(mm);
}
else
{
MailMessage mm = new MailMessage();
SmtpClient smtp = new SmtpClient();
mm.From = new MailAddress(FromE);
mm.To.Add(new MailAddress(To_1));
mm.To.Add(new MailAddress(To_2));
mm.Subject = "Exception Report from " + Client_Domain + "In EXAM/CLASS";
mm.Body = "An Exception Occured, but it has not Been Realised.You can Wait for the Client to log a Fault";
mm.IsBodyHtml = true;
smtp.Host = Server_Host;
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = Networked_Username;
NetworkCred.Password = Gmail_Password;
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = Gmailport;
smtp.Send(mm);
}
}
catch (ApplicationException ex)
{
Response.Write(ex.Message);
}
}
as you can see the code, the values are comming from a webConfig, you can change them so that they come from your ASP.NET page.
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi!
Can someone please tell me how I can retrieve the UserId from the aspnet_users table when I use the login tools in ASP.NET?
I am logging in as registered user and then when I click on edit profile I need the edit profile page to load with the UserId because I have made a one-to-one relationship between aspnet_users and Person table.
I am using a DataSet in a Seperate DAL. Basically I have configured the query to select record by UserId but I cannot get the correct GUID value from the aspnet_users table when going to editprofile page.
Thank you!!
Illegal Operation
|
|
|
|