|
I am using below query
SqlConnection con = new SqlConnection("server = MUNESH;Database=datastore;UID=sa;Password=123;");
SqlCommand cmd = new SqlCommand("Select * from data1", con);
try
{
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(dt);
BindingSource bsource = new BindingSource ();
bsource .DataSource = dt;
dataGridView1.DataSource = bsource ;
da.Update(dt);
DataSet ds = new DataSet("New_DataSet");
ds.Locale = System.Threading.Thread.CurrentThread.CurrentCulture;
da.Fill( dt );
ds.Tables.Add( dt );
ExcelLibrary. DataSetHelper.CreateWorkBook("MyFirstExcelSheet.xls" ,ds);
}
catch (Exception ec)
{
MessageBox.Show(ec.Message);
}
Once its export the same data for three times in the same excel sheet
|
|
|
|
|
1) Open SQL Server Management Studio
2) Run Query
3) Right-click in results pane (Copy - with or without "headers")
4) Open Excel
5) Paste
6) Charge client $1000.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Below is my class for the json output:
class PwdResetRequest
{
public class TopScoringIntent
{
public string intent { get; set; }
public double score { get; set; }
}
public class Intent
{
public string intent { get; set; }
public double score { get; set; }
}
public class Resolution
{
public string value { get; set; }
}
public class Entity
{
public string entity { get; set; }
public string type { get; set; }
public int startIndex { get; set; }
public int endIndex { get; set; }
public Resolution resolution { get; set; }
}
public class RootObject
{
public string query { get; set; }
public TopScoringIntent topScoringIntent { get; set; }
public List<Intent> intents { get; set; }
public List<Entity> entities { get; set; }
}
}
Luis Return result:
{
"query": "create a new password for sjao9841@demo.com",
"topScoringIntent": {
"intent": "ResetLANIDpassword",
"score": 0.9956063
},
"intents": [
{
"intent": "ResetLANIDpassword",
"score": 0.9956063
},
{
"intent": "None",
"score": 0.179328963
}
],
"entities": [
{
"entity": "sjao9841@demo.com",
"type": "builtin.email",
"startIndex": 26,
"endIndex": 47
}
]
}
I have developed the below code for getting the data from the json.
var uri =
"https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/" +
luisAppId + "?" + queryString;
var response = await client.GetAsync(uri);
var strResponseContent = await response.Content.ReadAsStringAsync();
var json = await response.Content.ReadAsStringAsync();
var token = JObject.Parse(json).SelectToken("entities");
foreach (var item in token)
{
var request = item.ToObject<Entity>();
}
Console.WriteLine(strResponseContent.ToString());
}
And I only want the data from the "TopScoringIntent". How can I get that using C#? Below is the code that I tried but nothing came out: Message=Error reading JObject from JsonReader. Path '', line 0, position 0. Source=Newtonsoft.Json
|
|
|
|
|
Sounds like the string "json" might be empty. It may be beneficial to not chain so much;
var token = JObject.Parse(json).SelectToken("entities");
vs
var MyJObject = JObject.Parse(json);
var MyJToken = MyJObject.SelectToken("entities"); The second version is more text, but easier with debugging when stepping through.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I am trying to edit your Conference System(PtoP)(project file) in Visual Studio 2017.
But VS community says Conference System need 'migration'
What should I do?
-- modified 28-Feb-18 21:58pm.
|
|
|
|
|
You should post this in the forum at the bottom of the article you're talking about.
Articles are supported by the people who wrote them, not the entire Code Project community.
|
|
|
|
|
I am trying to edit your Conference System(PtoP)(project file) in Visual Studio 2017.
But VS says Conference System need 'migration'
What requirements should I need?
=====================================================================================
Aking questions is a skill
CodeProject Forum Guidelines
Google: C# How to debug code
Seriously, go read these articles.
Dave Kreskowiak
|
|
|
|
|
It is NOT OUR "Conference System".
Again, post your questions in the forum at the bottom of the article you're talking about. Articles are supported by the people who wrote them.
|
|
|
|
|
Hi,
I have to build a service, which is kind of middle layer between System A and Third party system
- This middle layer should be MVC framework
- There can be multiple systems DB’s ( System A, System B….) which will interact with
this middle Layer
- The SQL database should be able make Async call to this middle layer system
- The calling system and this middle layer are in different in house domains
- This Middle Layer will receive XML from calling system DB which will contain data , this middle layer should be able to read/process and write XML and send it back to calling system ( based on third party system response)
I need suggestion on how to design this middle ware system.
Should I go for Web service? Web APIS? WCF? Or is there any better way to achieve this !
Any suggestions will be appreciated.
Thanks
modified 28-Feb-18 22:08pm.
|
|
|
|
|
Design it; build it; tune it.
"... with operations like reading and writing ..." is not quite a spec.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Are you saying it is built bit by bit?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I see the original post has been expanded...
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
modified 1-Mar-18 16:15pm.
|
|
|
|
|
You're going to need "web servers"; I don't see that in your mix; they will be hosting the "end points" to your "services".
You need some "physical" architecture; then apply the "logical".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
|
Am I reading the question wrong, or is it intended that SQL DBs are going to be making requests to the Service?
It just seems backwards to me; typically a Web Service would be converting a request into an SQL DB action, as opposed to the SQL DB making the requests.
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional
|
|
|
|
|
SQL db will call means Client will be sql db. I am planning to use CLR Object to achieve that. By Deploying a CLR Assembly.
|
|
|
|
|
hello evryone, i'm making a project using VS 2012 and crystal report i have a bill that could be in many pages and i have the summary of the bill at the end of the bill, i made my summary using Crystal Report and put it on the page footer section.
My problem is that when the bill have many pages the summary appears in all the pages.
is there a way to make the summary appears only in the last page of the bill.
and thanks a lot 
|
|
|
|
|
|
A page footer will be repeated fr each page (just as a page header).
Have you tried moving your report out of the footer?
"I'm neither for nor against, on the contrary." John Middle
|
|
|
|
|
It doesn't matter if it's Crystal Reports, a spreadsheet, a Word document, or just a letter to your Mum - all documents have "sections"
TM
______________
| Header |
|________|
| |
LM| Body |RM
| |
|________|
| Footer |
______________
BM TM , BM , LM , and RM are Margins - areas where you do not print (or not normally)
The Body is the area on the page where the actual content goes. Content flows from the Body of page 1 to the Body of page 2 seamlessly, and then continues in the Body of page 3, and so on
The Header and Footer are areas which are common to all pages (subject to special requirements) that are not part of the normal flow of content, and contain "metadata" such as a file reference, the page number, number of pages, production date, security classification, revision status, and so on. They do not contain content, they contain information about the content.
Whatever you put into the header or footer of any document will appear on all pages. You cannot put contecnt such as summary information there, that needs to be in the body of the document.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Fairly simple if I remember it correctly but you need to suppress the footer on all pages except for the last one:
right click on the page footer
go to Format text
write a conditional suppress formula.....
formula -----> PageNumber <> TotalPageCount;
|
|
|
|
|
You should be able to create sections in the body (see OGs reply) of the report, mode the summary out of the footer and into a section at the end of the body.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I need some help with an exercise. We've been asked to create a simple software to simulate GDPR compliance for a fake company that handles patient data.
The exercise itself required us to create:
> A secure database (done, Always Encrypted)
> Secure communication (done, SSL & Reliable Sessions)
> A way to store encrypted data on the server
Not sure how to best proceed with the third part. One client uploads a file, it should be stored encrypted on the server. A second client downloads that file and it should be decrypted.
Our idea was to store the key in two sets. The client software holds one part of the key. The Service holds the second part. After a client has been authenticated it sends a query to say GetKey() when it needs to en/de-crypt a file, using a SerializableSecureString. That string is then directly read into a SecureString on the client.
But I'm not sure if this is the best way to do it. Or, if a better solution would be do Encrypt/Decrypt the files on the server, storing any keys in DPAPI. The downside with that is, if an attacker gets hold of the server, by hacking rdp or something like tha,t it instantly gets hold of all files. If an attacker gets hold of a client machine, it will only get access to that users files and the files he/she can access.
Any ideas would be greatly appreciated.
/Updated for clarity to reduce OT replies. 
modified 28-Feb-18 14:07pm.
|
|
|
|
|
I think you are going to have to explain in more detail exactly what you are trying to do, and why you need this security - particularly where the source of the encryption keys is concerned.
As you know, encrypted data can't be decrypted without the key, so trying to get it client encrypted and different client decrypted without central key storage is going to be ... um ... problematic!
So we need to know a fair amount more about the whole idea and the relationship between the clients involved before we could begin to work out a suitable system.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Message Closed
modified 28-Feb-18 8:25am.
|
|
|
|