|
You're getting a NullReferenceException because you aren't returning anything. You're either passing in the serial number for an update statement (in which case you don't need to get it out), or you should be trying to SELECT SCOPE_IDENTITY after doing your insert to get the value of the record you inserted.
|
|
|
|
|
Pete O'Hanlon wrote: SELECT IDENTITY_SCOPE()
Or SCOPE_IDENTITY() as it's known!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That's only in those ol' versions of SQL Server. I'm running SQL Server 2432.
|
|
|
|
|
|
You will also get problems with this syntax if one of the text values includes an apostrophe, e.g. a name like "O'Connor" or "D'artagnan"
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Chris Quinn
No. I just tried it. It's working
|
|
|
|
|
Hello,
I'm using VS2010 with .Net 4.0 for a solution with numbers of ClassLibrary projects. One projet needs 4.5 functionnality so I've compiled it in VS2012 targetting .Net 4.5.
In my VS2010 solution, I can add references to the MyLibrary4.5.dll, but I can't use it (namespace unknown)
Can't we do that ?
|
|
|
|
|
Not in VS2010, no. That version of Visual Studio was released with .NET 4.
|
|
|
|
|
No. You cannot add a new dll to an older version of the framework.
|
|
|
|
|
I am using Google Auth api Calendar in .net. i am facing the same error in every Google apis code. And i donot know know ho to remove it. please HELP
My Error is: "Could not load type 'Google.Apis.Requests.IErrorResponseHandler' from assembly 'Google.Apis, Version=1.6.0.16897, Culture=neutral, PublicKeyToken=null'"
public ActionResult EmailSettings(string jsonData, string tokenAuthenticate, string clientID, string APIkey, string ClientSecret)
{
HttpContext.Application["EmailAdmin"] = jsonData;
HttpContext.Application["EmailAccessOken"] = tokenAuthenticate;
this.clientID = clientID;
this.APIkey = APIkey;
this.ClientSecret = ClientSecret;
CreateService(tokenAuthenticate);
return View();
}
private CalendarService CreateService(string token)
{
var provider = new NativeApplicationClient(GoogleAuthenticationServer.Description, this.clientID, this.ClientSecret);
var auth = new Google.Apis.Authentication.OAuth2.OAuth2Authenticator<NativeApplicationClient>(provider, (p) => GetAuthorization(provider, token));
CalendarService service = new CalendarService(new BaseClientService.Initializer()
{
Authenticator = auth,
ApiKey = ConfigurationManager.AppSettings[this.APIkey].ToString(),
GZipEnabled = false
});
return service;
}
private static IAuthorizationState GetAuthorization(NativeApplicationClient arg, String Refreshtoken)
{
IAuthorizationState state = new AuthorizationState(new[] { CalendarService.Scopes.Calendar.GetStringValue() });
state.Callback = new Uri(NativeApplicationClient.OutOfBandCallbackUrl);
state.RefreshToken = Refreshtoken;
return state;
}
modified 12-Dec-13 10:44am.
|
|
|
|
|
Please don't attempt to take people from this site to StackOverflow. That's not a very courteous thing to do.
|
|
|
|
|
Agree with Pete. If you want answer, mention all details clearly in your question. Besides some websites blocked on some workplaces(very rare thing). So update your question with complete details clearly.
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
|
Member 10457223 wrote: What should i put here: //PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt//
what path?? Your report Path(Where you have report files). For example, if you have your report files in some folder on D Drive, then code should be like below.
cryRpt.Load(@"D:\Somefolder\CrystalReport1.rpt")
But don't use hard code path, use Relative path . C# get project path[^]
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
I need to simulate keyboard and mouse actions in a simple C# Visual Studio Windows Application. Some years back, it was relatively simple to do this, as I recall. (Microsoft once even had a whole programming environment called MSTest built around this functionality.) Now, the only way that I see to do it within Visual Studio is with a Hyper-V WMI class. I do not see what library those classes are in, and I wonder if there is a simpler way anyway.
W. Johnson
|
|
|
|
|
What you are looking for is something called Automation Peers. You can find some information on this technology here[^], and using it in WPF here[^].
|
|
|
|
|
I wrote a C++ mixed-mode (native and CLI) DLL. Call this assembly C1. It has a project reference to another assembly called R1.
Then, I wrote another mixed-mode DLL called assembly C2. It also has a project reference to R1.
These mixed-mode DLL's are loaded by a native Windows application. The assemblies are unsigned.
Current versions of the mixed-mode DLL's work with the original version of the native application if all assemblies are updated. However, I have a requirement to be able to update C1 without updating C2. Unfortunately, C1 and C2 both share R1 as a common dependency, and different versions of R1 are incompatible. This defines the root problem.
In an effort to resolve this, I updated C1 to create a new application domain whose private path (for probing) is a sub-directory of the application directory. The new R1 is located in the sub-directory. The new C1 is located in the application directory. The old C2 and R1 are also located in the application directory. The new versions of C1 and R1 are signed. Denote the old assemblies as C1A, C2A, and R1A. Denote the new assemblies as C1B and R1B. I am logging assembly loads in a handler to the separate app domain's AssemblyLoad event.
When the application runs, I see that C1B is loaded. Then, R1B is loaded into the separate app domain. Unexpectedly, R1A is loaded into the separate app domain. When a type from R1 is instantiated, the runtime is using R1A instead of R1B. Due to the aforementioned incompatibility of R1 versions, all sorts of exceptions ensue.
I then ran ildasm.exe against R1A. Next, I ran ilasm.exe against the resultant .IL file, specifying the key I used when building R1B. This generated a signed version of R1A. Denote the unsigned R1A as R1A1 and the signed version as R1A2. Finally, I copied R1A2 into the application directory. Now, the runtime skips R1A2 and only loads R1B in the separate application domain.
To me, the behavior of R1A1 violates the entire purpose of generating strongly named assemblies. What am I missing?
|
|
|
|
|
I've created two windows 8 applications. One of them was a very useful app. Lot of users gave me good feedback. And they wish i could improve it. Some site web has choosen this app as a very suggested app.
But because of my work, almost one year i didn't touch it. Now, i want to send my app to someone else who can take care of it.
Here is the link of my app http:
Another here is: http:
I don't care of money earning in the future from your part. But i really want my idea could help more peoples.
If someone has interested in it, please contact me with my gmail: comiscience@gmail.com I'm Bo. Please write me the mail with English, French or Chinese please.
And i also want to know where can i find you who want to continue my idea
Thanks
|
|
|
|
|
|
|
|
I'm developing a WCF RESTful web service with C# and .NET Framework 4.0. There is also a SQL Server database and I'm using Entity Framework Code First to access it.
And i use Android for get, post, ... in my service by json.
I have these two tables on SQL Server:
A user table for my application's user.
User
{
userId,
name,
country
}
And another table to store their thoughts about something.
Thought
{
thoughtId,
userId,
descrip
date
}
Now, I want to show mething like this:
User.name
Thought.description
Thought.date
I follow http://forums.asp.net/t/1774830.aspx[^]
but i have a problem: the Json String is inValidate format and i Can't convert it in my android project.
How Can I return a JSON object this way?
Please help me.
|
|
|
|
|
mrhs wrote: How Can I return a JSON object this way?
You don't.
Your user is going to 'use' 'thoughts' (plural). So you create rest api methods that allow a user (singular) to manage one or more thoughts (plural). So for EXAMPLE (example only) you might have the following Rest methods.
- Get a thought (by id)
- Get all thoughts (a list) for a user.
- Create a thought
- Delete a thought.
If you want the user to manage themselves then you would provide similar methods to manage the user (but not the thoughts.)
|
|
|
|
|
It was a bad sound.
Please help me to create or give me a idea.
I'm newbie in Android and WCF Rest service.
Thanks alot.
|
|
|
|
|
What specific part of the break down that I gave you did you not understand?
|
|
|
|