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.– Jéf Bueno
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– Neuber Oliveira
@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);
– Henrique Gusmão
My method:
public static void ConverterJSON(List<Tabela> listaAlterada)
 {
 string json = JsonConvert.SerializeObject(listaAlterada);
 File.WriteAllText(@"meuCaminho", json);
 }
– Henrique Gusmão
@Neuberoliveira, I’m having a hard time getting my data and communicating with Firebase..
– Henrique Gusmão
It was a little clearer @jbueno.. sometimes I couldn’t explain it properly yet.. =/
– Henrique Gusmão
@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.
– Jéf Bueno
@jbueno, I’ll do it then! thank you very much. I will edit and I will be very grateful if you can help me!!
– Henrique Gusmão
Voce can do an Insert/set of anything in firebase via code? why it seems to me that the question is exactly this.
– Neuber Oliveira
The intention is precisely to help. Directly, or help improve the question so that someone can answer.
– Jéf Bueno
@Neuberoliveira I don’t know how to use the Insert/set in Firebase. I edited my question, it became clearer?!
– Henrique Gusmão
@jbueno, edited, improved?
– Henrique Gusmão
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.
– Neuber Oliveira
valeu @Neuberoliveira!!
– Henrique Gusmão
If you already have the JSON file, you can import it to Firebase Console.
– Rosário Pereira Fernandes