|
Hello. I have taken backup of MySql database using MySqlDump and it is named as MyBackup.Sql (SchemaName = TestSchema, TableName = TestTable). Now let us suppose I don't have MySql Workbench so I can not examine this database using Data Import.
Now how do I add/update/delete records using this .sql file? I don't know what the connection string will look like and all the related stuff. Thanks for any input.
|
|
|
|
|
Django_Untaken wrote: Now how do I add/update/delete records using this .sql file? You can't; a backup of a database does not offer the same functionality as a database.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Then how will I deploy the database with my .exe? I want this database (along with my .exe project) to be available on other computer where there is no visual studio, no sql server or no mysql workbench?
|
|
|
|
|
If you don't have SQL or MySql installed and available, then your backup is completely useless.
If you are looking at a single user for the database, then consider changing to SQLite or SQLCE, or even Access, none of which require a dedicated server application to use a database - just a couple of DLL files which can be distributed with your application.
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
hello sir/madam,
I am Shrirkishna i looking for code and details about online exam project.
|
|
|
|
|
What exam? Any specific code, or should I list every .NET project from CodePlex?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
I guess he asked about an online Campus where he can learn about C# and MySQL server (even though I'd rather go for MariaDB) - He's not on the homework-asking level yet
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.
|
|
|
|
|
Try creating something and then post any issues you run into.
|
|
|
|
|
There is plenty of self-learning stuff out there:
Connect C# to MySQL[^]
ZetCode.com MySQL C# Tutorial[^]
People becoming wiser in order to notice the stupid things they did back in the young days. This doesn't mean that they really stop doing those things. Wise people still do stupid things, only on purpose.
|
|
|
|
|
Hello,
First of all sorry for my english.
My Case:
I have ann application to querry Active directory and some log files and show the output in a nice GUI.
Thiss app help many of my collegas to get information about users.
I would like to be able to notify my stuff about one of the user:
i can't understand how i can temporary save all output of my querry on the server and then send a notification to a concerned collega.
Hi might be able to retrive the result of the querry.
-----
I have already a running server with Objects necessary for my application on tcp channel with singlecall.
Thanks in advance for help
|
|
|
|
|
Don't post this in multiple places - it duplicates work and annoys people.
You have this posted in QA, so leave it there and don't add it elsewhere...
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|
|
This is my XML structure after serializing
="1.0"
<ArrayOfTaskModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TaskModel>
<TaskID>Task ID 1</TaskID>
<TaskDecs>Task Desc 1</TaskDecs>
<TaskPerson>Task Person 1</TaskPerson>
<TaskLong>Task Long 1</TaskLong>
<TaskLat>Task lat 1</TaskLat>
<TaskQuestions>
<TaskQuestion>
<TaskQuestionId>1</TaskQuestionId>
<TaskQuestionType>Task Type 1</TaskQuestionType>
<TaskQuestionTitle>Task Title 1</TaskQuestionTitle>
<TaskQuestionDesc>Task Desc 1</TaskQuestionDesc>
<TaskQuestionAnswers>
<string>test</string>
<string>test2</string>
</TaskQuestionAnswers>
<Answers>
<string>test</string>
<string>test2</string>
</Answers>
</TaskQuestion>
</TaskQuestions>
</TaskModel>
</ArrayOfTaskModel>
Now I want to add all data from this xml file into my datagridview. I tried to use this code
XmlSerializer xmlser = new XmlSerializer(typeof(List<TaskModel>));
StreamReader srdr = new StreamReader(@"D:\myfile.xml");
List<TaskModel> p = (List<TaskModel>)xmlser.Deserialize(srdr);
srdr.Close();
dataGridView1.DataSource = p;
With my TaskModel class is
public class TaskModel
{
public string TaskID { get; set; }
public string TaskTitle { get; set; }
public string TaskDecs { get; set; }
public string TaskPerson { get; set; }
public string TaskLong { get; set; }
public string TaskLat { get; set; }
public string TaskTime { get; set; }
public List<TaskQuestion> TaskQuestions { get; set; }
}
And TaskQuestion.cs is
public class TaskQuestion
{
public string TaskQuestionId { get; set; }
public string TaskQuestionType { get; set; }
public string TaskQuestionTitle { get; set; }
public string TaskQuestionDesc { get; set; }
public List<string> TaskQuestionAnswers { get; set; }
public List<string> Answers { get; set; }
}
If I deserialize with the above code, I just get some element of TaskModel, except TaskQuestions because it
TaskID | TaskTitle | Task Desc | TaskQuestionID | TaskQuestionType | TaskQuestionAnswers Please help me.
|
|
|
|
|
don't use this code as follow:
ManagementBaseObject inPar = null;
ManagementBaseObject outPar = null;
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
<pre lang="cs">inPar = mo.GetMethodParameters("EnableStatic");
inPar["IPAddress"] = new string[] { "192.168.16.248", "192.168.16.249" };
inPar["SubnetMask"] = new string[] { "255.255.255.0", "255.255.255.0" };
outPar = mo.InvokeMethod("EnableStatic", inPar, null);
If the WMI service is not open, then you can not use it
Is there any other way????
|
|
|
|
|
|
+1
|
|
|
|
|
|
Hi all,
I want to develop an application which reads DTD file and provides form to user for requested data and generate xml out of it. Can anybody help with how to read DTD file in c#?
Thanks
|
|
|
|
|
A DTD files[^] is just text, so you read it with a TextReader [^]. The link above will help you to interpret the content.
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
I hope somebody can help me and I hope I put my questions into the right forum !!
If not pls let me know !!
I received a c++ dll with a function inside:
int FunctionCall(int* Size, unsigned char Data[], int time)
I used the DLLImport:
[DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int FunctionCall(IntPtr Size, byte[] data, int timeout);
But when I debug I always get an out of range error !!
What did I wrong ??
Thank you very much for your help !!
|
|
|
|
|
You need to show the code that gives the error, the exact error code or message, and the values of all the variables that are used in the call to the C++ function.
Veni, vidi, abiit domum
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Data;
namespace ConsoleApplication1
{
class Program
{
[DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int Fct1();
[DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int Fct2();
[DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int Fct3(IntPtr Size, byte[] data, int timeout);
[DllImport("Function.dll", CallingConvention = CallingConvention.Cdecl)]
extern static int Fct4(int size, byte[] data);
static void Main(string[] args)
{
byte[] data = new byte[5] {0x01,0x02,0x03,0x04,0x05};
int result = Fct1();
Console.WriteLine(result);
result = Fct2((IntPtr)2, data, 3);
Console.WriteLine(result);
result = Fct3(3, data);
Console.WriteLine(result);
result = Fct4();
Console.WriteLine(result);
}
}
}
ErrorMessage:
AccessViolation at Fct2
|
|
|
|
|
|
Sorry to bother you
I´m very glad about your help !!
And I have to excuse me but I don´t have much experience in C# coding..
I will give you more details what I want to do:
I have a windows programm from and I have to make a communication to this programm.
The supplier of the other programm provided me a dll with different functions inside.
Now from my understanding the easiest way to setup the communication is to use this dll.
So I only wanted to make a short trial if I can call this functions and if the communication can be
established !
Fct1, Fct3 and Fct4 are returning a value that shows a good result.
The problem is Fct2 where I have to deal with pointer (
Thanks again !!
|
|
|
|
|
Even if your code was good, you cannot pass a pointer to a constant value!
The point of passing a pointer is so that the method you call can modify the value in your program. If you could pass a pointer to "the number two" what do you expect to happen when the function tries to change it?
As I said, you almost certainly want to pass a ref int instead of an IntPtr as the former actually passes a pointer rather than a value in a "pointer package"! (And C# won't let you call your method as Fct2( ref 2, data) for precisely the reasons above)
The only instant messaging I do involves my middle finger.
English doesn't borrow from other languages.
English follows other languages down dark alleys, knocks them over and goes through their pockets for loose grammar.
|
|
|
|