Export Data to Firebase

Asked

Viewed 371 times

0

I would like to export data to my BD Firebase.

I have a service set up in Visual Studio in C# which creates a list with name and price. I need to export this data to Firebase or export a txt file if you need to already do this.

Note: the data is already in format JSON.

Here I call my method to convert the format to JSON:

Library.ConverterJSON(listaAlterada);

In this other part is the method in which I convert the data:

public static void ConverterJSON(List<Tabela> listaAlterada)
    {
        string json = JsonConvert.SerializeObject(listaAlterada);
        File.WriteAllText(@"C:\Users\hmogu\OneDrive\Documentos\Visual Studio 2015\Projects\TestWindowsService\TestWindowsService\bin\Debug\JSON.txt", json);
    }

In this method I print the data in a txt file.

The question is this: I would like to take this data printed on the txt block of my machine and export/send it to my Firebase database.

  • And what is the question? In fact, in Lisbon it’s late. There’s no reason to say good morning =). Ah, important too, don’t use the tag visual-studio if your doubt is unrelated to the IDE, if you have any questions about it, you can read this question about IDE, programming language and compiler.

  • Not working with C# but if the data is already in json just give a set in the database, something like that(web version) firebase.database.ref().set(seuObjetoJson). Problem here is that it will erase everything you already have in the bank, overwrite from the root. But this is easily solvable. If you specify a little better the uqe needs becomes easier, until that is already in the documentation of firebase

  • @jbueno, has to say yes a greeting because it is a matter of education, regardless if it is not compatible with your spindle, just answer according to the same. Thanks for the tip about using tags and for not being accurate in using since I know what IDE is. My question as explained in the topic is the following: I need to export an array with data to popular my database in Firebase, the data is already in JSON format. Library.ConverterJSON(listaAlterada);

  • My method: public static void ConverterJSON(List<Tabela> listaAlterada)&#xA; {&#xA; string json = JsonConvert.SerializeObject(listaAlterada);&#xA; File.WriteAllText(@"meuCaminho", json);&#xA; }

  • @Neuberoliveira, I’m having a hard time getting my data and communicating with Firebase..

  • It was a little clearer @jbueno.. sometimes I couldn’t explain it properly yet.. =/

  • @Henriquegusmão I understand, but it is something discouraged by the site, since we want to give the total attention to doubt about programming, so greetings and thanks would be something kind of "unnecessary". If you want, you can read more about it in this publication about greetings and acknowledgments in the goal. Of course that’s not a rule, I’m just trying to give you a hint, you take it if you want. About the question: still think it is not clear, you can click [Edit], put your code and try to explain better the problem.

  • @jbueno, I’ll do it then! thank you very much. I will edit and I will be very grateful if you can help me!!

  • Voce can do an Insert/set of anything in firebase via code? why it seems to me that the question is exactly this.

  • The intention is precisely to help. Directly, or help improve the question so that someone can answer.

  • @Neuberoliveira I don’t know how to use the Insert/set in Firebase. I edited my question, it became clearer?!

  • @jbueno, edited, improved?

  • As said unca mexi com C#, firebase has no official library for C# but you can do the basics of the bank via REST API or looking for a third-party C# SDK. Good luck.

  • valeu @Neuberoliveira!!

  • If you already have the JSON file, you can import it to Firebase Console.

Show 10 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.