[Solved] Oracle database multiple row -> c# [closed]

[ad_1] Let’s brush up your code: // Extract methods, don’t cram everything in OnClick private void FeedFriendsListBox() { string oracleDb = @”connection string”; //DONE: wrap IDisposable into using using (OracleConnection conn = new OracleConnection(oracleDb)) { conn.Open(); //DONE: Make Sql readable – format it out and use names for the parameter(s) string sql = @”SELECT NAME, … Read more

[Solved] can’t understand where is syntax error [closed]

[ad_1] 1) scanf(“%s”,input) and not scanf(“%s”,&input) input holds the address of the array. &input passes the address of input. 2) Syntax of for loop is: for ( init; condition; increment ) { //code } Hence the for loop should be: for(i=0,j=c-1;i<=j && j>=0;i++,j–) 6 [ad_2] solved can’t understand where is syntax error [closed]

[Solved] Convert JSON string to data array using javascript or c# [closed]

[ad_1] Example JSON String string data = “{ \”A\” : \”1\”, \”B\” : \”2\”, \”C\” : \”3\” }”; Deserializing it into an object that will contain each of the keys and their values object yourObject = new JavaScriptSerializer().DeserializeObject(data); 1 [ad_2] solved Convert JSON string to data array using javascript or c# [closed]

[Solved] Using getchar() to Read Two Strings

[ad_1] You need to add string terminators ‘\0’ to your string before printing (or zero out the buffers memory first). Also: you have declared buffers of size 20, but have no guards in your code to respect that allocated length, which means you could overrun them and corrupt memory. [Run with two words greater than … Read more

[Solved] how to sort 5 strings according to their length and print it out

[ad_1] As suggested you can use sort #include <iostream> #include <vector> #include <algorithm> using namespace std; int main () { std::vector<string> vec={“abc”,”defsf”,”a”,”c”}; cout<<“Unsorted string”<<endl; for(auto s: vec) { cout<<s<<” “; } std::sort(vec.begin(),vec.end(),[](const string& a,const string& b) { return a.size()<b.size(); }); cout<<endl<<“Sorted string”<<endl; for(auto s: vec) { cout<<s<<” “; } return 0; } [ad_2] solved how … Read more

[Solved] How to separate words from a sentence (only using character arrays and no built-in c++ functions)? [closed]

[ad_1] I think you’d like to separate all of the words in this sentence, so you can’t make loop stop when it meet first blank. #include<iostream> using namespace std; int main() { char sentence[100]={‘\0’}, word[100]={‘ ‘}; cin.getline(sentence,100); for(int i = 0; sentence[i] != ‘\0’; i++) { word[i]=sentence[i]; } cout << word; } Above code may … Read more

[Solved] Add one to C# reference number

[ad_1] Homework or not, here’s one way to do it. It’s heavily influensed by stemas answer. It uses Regex to split the alphabetical from the numeric. And PadLeft to maintain the right number of leading zeroes. Tim Schmelters answer is much more elegant, but this will work for other types of product-numbers as well, and … Read more

[Solved] How to send mail using C# with html format [closed]

[ad_1] Setting isBodyHtml to true allows you to use HTML tags in the message body: SmtpClient sc = new SmtpClient(“mail address”); MailMessage msg = null; try { msg = new MailMessage(“[email protected]”, “[email protected]”, “Message from PSSP System”, “This email sent by the PSSP system<br />” + “<b>this is bold text!</b>”); msg.IsBodyHtml = true; sc.Send(msg); } catch … Read more

[Solved] Validate that connection string is for Sql Server 2008 [closed]

[ad_1] I don’t know why you need to validate or users are entering a connection string but you can find connections strings for sql 2008 from below link. http://www.connectionstrings.com/sql-server-2008 Standard Security Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword; Use serverName\instanceName as Data Source to connect to a specific SQL Server instance. Are you using SQL Server 2008 Express? … Read more

[Solved] Basic Auth in metro app using C# [closed]

[ad_1] I assume you’re talking about Basic Http Authentication, if you’re using HttpClient to make your web service calls then you can enable set a Basic authentication header with the following code. var request = new HttpRequestMessage(HttpMethod.Get, uri); var token = Convert.ToBase64String(Encoding.UTF8.GetBytes(String.Format(“{0}:{1}”, username, password))); request.Headers.Authorization = new AuthenticationHeaderValue(“Basic”, token); The simplest (and cleanest) way, however: … Read more