how to use linq group by in dataset

hi ;

I have a dataset that filled the below query

SELECT FIELD1,FIELD2,FIELD3,FIELD4

I want to group by that query according to FIELD4

Thanks from now .

Email sending a duplicate

Hello

My SMTP code sents an email and a duplicate to the user at exactly the same time (so he receives two emails). To try to eliminate this duplicity, I have placed a breakpoint here in my vb.net SMTP code:
[code]Smtpserver.Send(myMessage)[/code] and then pressed F5. That loaded up my Web page (dimadayoub.net/forgot.aspx) which I then closed and then, from the menubar, selected 'Step into'. I am not quite sure what I am looking for (or where to look for it), but there is a list in the Locals pane, nothing in the Watch pane and, in Call stack, I see Global code [forgot.aspx] Line 104 and Language: Script. In the Command pane, I see an inexplicable lonely a right-pointing arrow and nothing else, nothing in the Immediate window, and in Output, under JavaScript Language Service, I get this:

12:07:42.5488: Referenced file '~/Scripts/_references.js' not found.

And yet, in the Scripts folder in Solution Explorer (VS 2013 Express), I can see the _references.js.

Any advice would be welcome.

Thank you.

How to call an action of the server, from a web page

I've developed a web project that works on an ms sql server database. The problem is caused by the fact that i have to sincronize some my table using an oracle view that i can see from my web server.

I've developed a dll that do this for me, and when i call it from the browser of my web server it works fine, but otherwise from other browser in the lan it doesn't works.

The main action in the dll that i suspect can create problema are:

1) i open a connection with the ms sql DB, this is the same connection of the main program, so i don't think is the point

2) i open a log file in "C:\Users\Public\Documents\". i'm not sure this is allowed to the program, maybe this is the point?

3) i create an ODBC connection to oracle :

serv = CreateObject("ADODB.Connection")
Dim prov As String = "DSN=PAI;Uid=PAI;Pwd=PAI2016;"

All works fine if i open my program from the broser of my server, but it doesn't works from other clien!

thanks for any suggestion!

Opening & Closing forms correctly

What would be the correct method to create an instance of a form? Currently, I add this to my AddinGlobal class in my Class project-
[code]Public Shared fForm As Form [/code] Then, when I need the form to be shown, I use this in the ribbon button command (loaded into Inventor)
[code]AddinGlobal.fForm = New fMain AddinGlobal.fForm.Show()[/code] This creates a new instance of the form. I have done it this way so that fForm can be accessed by other functions.

In my Form Class, I have these members that are new instances of some UserControls I have created [code]Public Shared pgStructure As New pAssyStructure Private pgAssembly As New pAssembly Private pgBorders As New pAssembly Private pgFlatPatt As New pFlatPattern Private pgPart As New pPart Private pgPresentation As New pPresentation Private pgSetting As New pSettings Private pgFrontSheet As New pFront[/code] Problem:

When I load the form first time, it works fine and everything loads as it should. When I close the form and then open it again, I get an error[img]https://social.msdn.microsoft.com/Forums/getfile/1010862[/img]
So, what is the best method to load the form, allow it to be accessible and open every time?

Thanks

System.Web.Security.MembershipUser.ChangePasswordQuestionAndAnswer Is encrypting PasswordAnswer

I’ve been using the System.Web.Security.MembershipUser.ChangePasswordQuestionAndAnswer method for several years and all has been fine. Now today something strange started happening. When I pass in the 3 parameters (password, passwordQuestion and passwordAnswer), the passwordAnswer appears to be encrypted when I view it in the sql aspnet_Membership table. For example, if I run this line of code:

user.ChangePasswordQuestionAndAnswer(“myPassword”, “myPet”, “dog”);

These are the values stored in the aspnet_Membership table:
Password = “myPassword”
PasswordQuestion = “myPet”
PasswordAnswer = “n51Do4TY8pYTAzyenYDe9d46Kjyc8oEbYbf4CRMzlE8=”

But I’m expecting PasswordAnswer to be “dog”.
Can anyone shed some light on what might be happening here?

everytime I used this in the past, PasswordAndwer would be "dog" in the aspnet_Membership table.

Additionaly, in the web.config file the SqlProvider passwordFormat attribute has always been set to "Encrypted" so this has not changed. Something else must have changed to cuase the PasswordAnswer to start encrypting.

Thank you.

Access/Download File OneDrive using vb.Net, is it possible..?

Dear Friends,

I have one file (Plain text File) in Microsoft OneDrive Public Folder,

I want to download or Access that file using VB.NET 2012.

Is there any way, Please

Thanks

Decrypt XML file error: Padding is invalid and cannot be removed

I encrypt an XML file and save it to the original file.
I then open the file and try to decrypt it, and get the error "Padding is invalid and cannot be removed".
I think this is because during encryption, I execute [code]key = New RijndaelManaged()[/code] And, during decryption, I also execute [code]key = New RijndaelManaged()[/code] How can I save the key from the encryption ?
Thank you.

This is the code to encrypt and save the XML file: [code]Imports System.Xml Imports System.Security.Cryptography Imports System.Security.Cryptography.Xml Dim key As RijndaelManaged = Nothing ' Create a new Rijndael key. key = New RijndaelManaged() ' Load an XML document. Dim xmlDoc As New XmlDocument() xmlDoc.PreserveWhitespace = True xmlDoc.Load("myXMLFile.XML") Encrypt(xmlDoc, "myElement1", key) Encrypt(xmlDoc, "myElement2", key) xmlDoc.Save("myXMLFile.XML")[/code] This is the code to decrypt the XML file: [code]Imports System.Xml Imports System.Security.Cryptography Imports System.Security.Cryptography.Xml Dim key As RijndaelManaged = Nothing key = New RijndaelManaged() Dim xmlDoc As New XmlDocument() xmlDoc.PreserveWhitespace = True xmlDoc.Load("myXMLFile.XML") Decrypt(xmlDoc, key)[/code]

how to insert data to database from datagridview?

I have some list of data in datagridview. More than 500 records in datagridview. i want to insert into database like this

for i =1 to 40

insert query 1.....

next

for i = 41 to 80

insert query 2.....

next

for i = 81 to 120
insert query 1.....

next

for i = 121 to 160
insert query 2.....

next

how to write a code in vb.net?

Android project, expanding preprocessor definition results in "error : stray '\' in program"

Hi !

I'm trying to compile two projects - I have made it so that one project is for Windows, another is for Android.

But basically same files are being compiled.

As a toolset I'm using gcc 4.9 for Android project.

In both project I have added extra define:

MODULE_STRING="core"

and windows project compiles fine, but in Android project I'm getting error:

1>..\src\audio_output\common.c(222,5): error : stray '\' in program
1> msg_Dbg( obj, "%s '%4.4s' %d Hz %s frame=%d samples/%d bytes", psz_text,
After expanding macro define I've realized that Microsoft C++ compiler pocesses "core" as a string, but in gcc

it result in following command line to gcc:

.. -D "MODULE_STRING=\\"core\\"" -x c++ ...

which results in \core\ macro expansion instead of "core" like in Microsoft compiler.

New bug ?

Trapping Key presses in C# Child form

I have seen several posts about trapping keys presses but none specific to child forms. In the code fragments below Key presses are trapped when the focus is the parent form but not when the focus is the child form. What else do I need to do to trap those also? I would also like to be able to trap arrow keys in the child form if possible. Unrelated code deleted. [code]public partial class Main : Form { private void btGraph_Click(object sender, EventArgs e) { Graph WaveGraph = new Graph("Waveform"); other code placing graphics on the form } // need to trap arrow keys. protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (keyData == Keys.Up) { MessageBox.Show("Up key pressed"); return true; } return base.ProcessCmdKey(ref msg, keyData); } } class Graph { public Graph(string name) { GraphForm = new Form(); GraphForm.Name = name; GraphForm.KeyPress += new KeyPressEventHandler(OnKeyPress); GraphForm.KeyPreview = true; } // The message box never appears private void OnKeyPress(object sender, KeyPressEventArgs e) { string KeyString = e.KeyChar.ToString(); MessageBox.Show("A key was pressed"); return; } }[/code]
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir