|
Hi All,
I have an asp.net application in which I am using two tables, Table1 and Table1Staging. Staging table data is updated every month.
And both have the same columns except the identity columns for the two tables are different. The reason for that is Table1 is transactional table so that we have to use an Identity columnfor that, here we are doing it with Unique Identifier. And there is an identity column in Staging table as auto increment integer for the sake of Entity Framework.
They both have a unique contraint column called clientId on which I am going to write all the logic to update or modify.
Now my question is I want to get all the rows in the staging table whose clientid exists in staging table but doesnt exist in transactional table, similar to not in operator in SQL Query.
Please if somebody can help me that would be really helpfull. I am searching from my side also. But if someone can help me its really great.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 17-May-13 17:44pm.
|
|
|
|
|
See here[^]. Couldn't you call a stored procedure or even a view to do the heavy lifting?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
Those who seek perfection will only find imperfection
nils illegitimus carborundum
me, me, me
me, in pictures
|
|
|
|
|
Hi @all
I´m new to Expressiontrees and their invocation...
but they seem to be really mighty and useful...
I know that one can extend expressiontrees, but up until now I wasn´t been able to fully comprehend how to do that..
practically I want to "convert" this lambda into an expressiontree:
(o => o.LognName == name)
and I do that by this
Expression<Func<Users_UserAccount, bool>> whereLogonName = LinqExtender.DynamicLinq.BuildOrTree<Users_UserAccount, string>(LogonName, UserAccount => UserAccount.LogonName);
so far so good. I also know that I now can query multiple users... fine thing...
what´s really cool about this is, that expressiontree returns whatever you need takes any type of parameter... a fine thing would be if I was able to pass the correct "sql/linq" query to it...
to be honestly, my desire goes for this:
(o => o.LognName == name && o.LogonPW == "12345")
now my question is:
how to link different params in an expressiontree?
I heard about
Expression.Or
Expression.And
and am using it, but I feel that this does not function properly and as desired...
here´s my function of the treebuild:
public static Expression<Func<TValue, bool>> BuildOrTree<TValue, TCompareAgainst>(
IEnumerable<TCompareAgainst> wantedItems,
Expression<Func<TValue, TCompareAgainst>> convertBetweenTypes)
{
ParameterExpression inputParam = convertBetweenTypes.Parameters[0];
Expression binaryExpressionTree = BuildBinaryOrTree(wantedItems.GetEnumerator(), convertBetweenTypes.Body, null);
return Expression.Lambda<Func<TValue, bool>>(binaryExpressionTree, new[] { inputParam });
}
I've found that on the interwebs...it´s NOT mine...but with very few changes, I've also implemented the AND-equivalent. whoa... what an effort...
so, to put long things short:
how to combine the both of them to achieve the desired query?
thanks in advance!
what a cool community
[edit]
forgot that:
private static Expression BuildBinaryOrTree<T>(
IEnumerator<T> itemEnumerator,
Expression expressionToCompareTo,
Expression expression)
{
if (itemEnumerator.MoveNext() == false)
return expression;
ConstantExpression constant = Expression.Constant(itemEnumerator.Current, typeof(T));
BinaryExpression comparison = Expression.Equal(expressionToCompareTo, constant);
BinaryExpression newExpression;
if (expression == null)
newExpression = comparison;
else
newExpression = Expression.OrElse(expression, comparison);
return BuildBinaryOrTree(itemEnumerator, expressionToCompareTo, newExpression);
}
sorry
ps:hopefully I dove into the correct forum...
aaargh, ultraedit:
addendum:
LogonName in the lambda was of type string, the Expressionparam is of type string[]
addendum 458:
as one might suspect:my math knowledge is not that sophisticated... the term binarytree is familiar to me since 4 days or 5...
but, i´m somewhat able to use it...
just like luke skywalker and his lasersword...
he is capable to use it as a weapon, but is he able to assemble it!?
modified 17-May-13 9:25am.
|
|
|
|
|
once more I´ve forgotten something...namely the calling of that expression:
Expression<Func<Users_UserAccount, bool>> whereLogonName = LinqExtender.DynamicLinq.BuildOrTree<Users_UserAccount, string>(LogonName, Users_Users => Users_Users.LogonName);
Expression<Func<Users_UserAccount, bool>> whereLogonPW = LinqExtender.DynamicLinq.BuildAndTree<Users_UserAccount, int>(siteparam, Users_Users => Users_Users.LogonPW);
Users_UserAccount medProOrignal = ce.Users_UserAccount.Where(whereLogonName).Where(whereLogonPW ).First();
but I found out, that there´s a 'priority-problem', when using .First();
but that´s so obvious...
consider the following:
two users:
user a:
UID:1 logonname: gargamel PW: a
user b:
UID:2 logonname: gargamel PW: b
actually I've overseen the fact that I was using .First()
.First() will simply take UID1 becoz it´s the first one found...
now I've tried it with .Single() and it returns the desired user...
but what left me dumb is the fact, that I can´t see the way this query get´s prioritized in terms of params...
actually, I hope my question is considerably clear and that I forgot nothing...
[eeedit]
I "profiled" it in SQLM MGMT Profiler but i´m veeery weak in SQL... no clue at all..
modified 17-May-13 9:21am.
|
|
|
|
|
Hi,
I have seen in some website they use different fonts than the standard. For example:
.yakoutb
{
font-family: 'Yakout W20 Bold';
}
How can I do this?
Technology News @ www.JassimRahma.com
|
|
|
|
|
|
body
{
font-family:Arial, Helvetica, sans-serif;
}
|
|
|
|
|
download the font if you like;put this in website Directory, like css Directory and so on.and user this.I 'll sell look like this in Apple.com
|
|
|
|
|
Hi,
I have a Datalist Which have some linkbuttons which redirects to other page with querystring .
on click it is redirecting to other page with QueryString.
If i am right click on the datalist linkbutton and try to open in new tab, only blank page is opening.
Guys if u have some solution regarding this please help me.
Regards,
Mrityunjay
|
|
|
|
|
Don't use a LinkButton[^] for this; use a HyperLink[^] instead.
Clicking a LinkButton will cause the current page to post back to itself and run through the entire page lifecycle. Your code will then call Response.Redirect , which will return an HTTP 302 response telling the browser to request a different page.
Clicking a HyperLink will cause the browser to request the correct page directly.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
need to download file when user click on file .
|
|
|
|
|
The easiest way to do this is have a hyperlink to the file. When they click it, their browser will download it. You can also look into Response.TransmitFile().
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I need a freeware or the any .dll or any project that can take a pdf as input and convert the images inside the pdf into a text (.txt ) fromat. and the programming language used is C#
This can be done in two ways:-
1)Take Input pdf and Extract images.--1st API.
2) Take the extracted images and convert to .txt & also convert the text inside the pdf to plain text(.txt) -- 2nd API.
OR 2nd way :-
1) Take pdf input and directly extract text from images as well as the text inside the pdf.
------------------Please HELP------
Thanks a lot.
~Regards
Kaushal Behere
kaushalpbehere@gmail.com
kaushalpbehere@hotmail.com
|
|
|
|
|
Hi people,
Could you please help me on how to convert an html document to a pdf document. I need like a free third party tool that can do the job. I've tried iTextsharp but it won't copy the styles from the html document to the pdf file. I've also tried Winnovative, but it prints out a watermark specifying that I am using a demo version.
I need a solution that can convert the file to pdf without the watermark but with the styles. Thanks a lot in advance guys.
Kind Regards,
Denzil.
|
|
|
|
|
Not sure but just try this: http://www.evopdf.com/[^]
Be a good professional who shares programming secrets with others.
|
|
|
|
|
Hi Mohammed, I've also used Evo, but it's a demo version, and the watermark specifying that it's a demo version still prints out on the output.
|
|
|
|
|
You can try its trial period till it expires and if it fits for your requirement fully then you can think of purchasing the license.
Be a good professional who shares programming secrets with others.
|
|
|
|
|
I was giving a project to remove all silverlight components from a website. my question is this possible or should I just rewrite the site as an asp.net wed application
|
|
|
|
|
It depends. Is it a silverlight project? Then yes, you likely should rewrite it. Or, is it an asp.net web app that loads some pages that have silverlight?
I think either way you'll have to re-write whatever the SL was doing.
Good luck.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi, I need Chat box component (like as FB chat room) for a social network site.
|
|
|
|
|
And which of the hundreds of freely available components did you try and why did they not meet your needs? You have to give us something to go on here. There's no reason in your question why I shouldn't sell you my million dollar chat box component, right? It's really shiny.
|
|
|
|
|
|
I use WebMatrix 3. I've got an ASP.NET Web Pages site that draws fractals, it uses a SQL Compact database and works fine locally.
But after I published it to the Azure Cloud and tried it, I get an error in the Database.cshtml that it doesn't work. Error: Failed to find or load the registered .Net Framework Data Provider.
The URL is: http://aljo-fractals.azurewebsites.net Click on the option Database and you'll get to see the error.
I guess I need to add a framework to use the database, where do I get that?
This must be easy to fix, but how...
|
|
|
|
|
Hi,
I have developed an ASP.net VB application on 1.1 in which we insert certain data into a particular table which is on sybase.
My table structure:
CREATE TABLE dbo.at_ip_disbursement
(
doc_id numeric(7,0) IDENTITY,
doc_type varchar(30) NOT NULL,
rim_no int NOT NULL,
item_type varchar(80) NULL,
customer_name varchar(80) NOT NULL,
rsm_name varchar(80) NOT NULL,
branch_no int NULL,
business_unit varchar(30) NOT NULL,
input_dt datetime NOT NULL,
Category varchar(30) NULL,
deferral_details nvarchar(600) NULL,
days_deferred int NULL,
Deff_Expdt datetime NOT NULL,
Deferred_Dt datetime NULL,
rm_comments nvarchar(600) NULL,
creator_id varchar(10) NULL,
modifier_id varchar(10) NULL,
status char(1) NOT NULL,
App_Authority nvarchar(600) NULL
)
LOCK ALLPAGES
go
IF OBJECT_ID('dbo.at_ip_disbursement') IS NOT NULL
PRINT '<<< CREATED TABLE dbo.at_ip_disbursement >>>'
ELSE
PRINT '<<< FAILED CREATING TABLE dbo.at_ip_disbursement >>>'
go
Now the piece of code where the insert takes place:
Public Shared Function AddDisbursement(ByVal DocType As String, ByVal Rim As Int32, ByVal CustomerName As String, ByVal RSMName As String, ByVal BranchNo As Int32, ByVal Business As String, ByVal InputDate As String, ByVal Category As String, ByVal DeferralDetails As String, ByVal DeferredDays As String, ByVal DefExpDate As String, ByVal DefDate As String, ByVal RMComments As String, ByVal CreatorId As String, ByVal App_Authority As String, ByVal Item As String) As String
Dim logger As SKLogger = New SKLogger
Dim connMosaic As String = System.Web.HttpContext.Current.Session("connStr").ToString()
Dim cmdText As String
cmdText = "INSERT INTO at_ip_disbursement(" & _
"doc_type, " & _
"rim_no, " & _
"customer_name, " & _
"rsm_name, " & _
"branch_no, " & _
"business_unit, " & _
"input_dt, " & _
"Category, " & _
"deferral_details, " & _
"days_deferred, " & _
"Deff_Expdt, " & _
"Deferred_Dt, " & _
"rm_comments, " & _
"creator_id, " & _
"status, " & _
"App_Authority, " & _
"item_type) " & _
"VALUES (" & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"?," & _
"'A'," & _
"?," & _
"?)"
Dim conn As OdbcConnection = New OdbcConnection(connMosaic)
Dim cmd As OdbcCommand = New OdbcCommand(cmdText, conn)
cmd.Parameters.Add("@DocType", OdbcType.VarChar).Value = DocType
cmd.Parameters.Add("@Rim", OdbcType.Int).Value = Rim
cmd.Parameters.Add("@CustomerName", OdbcType.VarChar).Value = CustomerName
cmd.Parameters.Add("@RSMName", OdbcType.VarChar).Value = RSMName
cmd.Parameters.Add("@BranchNo", OdbcType.Int).Value = BranchNo
cmd.Parameters.Add("@Business", OdbcType.VarChar).Value = Business
cmd.Parameters.Add("@InputDate", OdbcType.Date).Value = InputDate
cmd.Parameters.Add("@Category", OdbcType.VarChar).Value = Category
cmd.Parameters.Add("@DeferralDetails", OdbcType.VarChar).Value = GetNull(DeferralDetails)
cmd.Parameters.Add("@DeferredDays", OdbcType.Int).Value = DeferredDays
cmd.Parameters.Add("@DefExpDate", OdbcType.Date).Value = DefExpDate
cmd.Parameters.Add("@DefDate", OdbcType.Date).Value = GetNull(DefDate)
cmd.Parameters.Add("@RMComments", OdbcType.VarChar).Value = GetNull(RMComments)
cmd.Parameters.Add("@CreatorId", OdbcType.VarChar).Value = GetNull(CreatorId)
cmd.Parameters.Add("@App_Authority", OdbcType.VarChar, 1200).Value = GetNull(App_Authority)
cmd.Parameters.Add("@Item", OdbcType.VarChar).Value = GetNull(Item)
Try
conn.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
logger.LogException("AddDisbursement", ex.ToString())
AddDisbursement = ex.Message
Finally
cmd.Dispose()
conn.Close()
End Try
'Return True
End Function
Now through javascript i allow user to input only 500 Characters(which works perfectly). Once the user submits data (say for example 400 characters) which is under the field "App_Authority" i get the following error:
ERROR [HY000] [INTERSOLV][ODBC SQL Server driver][SQL Server]ct_param(): user api layer: external error: A data length of 399 exceeds the maximum length allowed for CHAR data.
The same happens when i try to insert data into fields "RMComments" and "DeferralDetails"
Kindly advise me.
Thanks in Advance
|
|
|
|
|
<<tash18>> wrote: cmd.Parameters.Add("@App_Authority", OdbcType.VarChar, 1200).Value = GetNull(App_Authority)
Above is varchar, but in the table, you made it nvarchar,
It's a mismatch, that involves unicode I think, in which one is double the space of the other,
varchar is a 8bit codepage
[edit]
adjust your column in the table to take 1200 or whatever the value is suppose to be or vice versus
App_Authority varchar(1200) NULL
|
|
|
|
|