1
I am making a web page that does a database search and using in only one machine everything is normal, however, when the search is used more than once, as for example, in two different machines, the error search.
I tested other search modes, but also the error, I wanted to know if there is any way to leave this asynchronous search with the mode async/await
or something like, follows the search and error:
public static FbDataAdapter GetDataAdapter(string query)
{
FbConnection myConn = ConnectionFB.GetInstance().GetConnectionFb();
myConn.Close();
myConn.Open();
FbDataAdapter da;
try
{
da = new FbDataAdapter(new FbCommand(query, myConn));
}
catch (Exception ex)
{
throw new Exception("Impossível criar tabela a partir de uma instrução SQL.",
ex.InnerException);
}
return da;
}
public static DataSet GetData(string query)
{
DataSet ds = new DataSet("dsPadrao");
try
{
FbConnection.ClearAllPools();
FbDataAdapter da = new FbDataAdapter(new FbCommand(query, myConn));
da.Fill(ds);
}
catch (Exception ex)
{
throw new Exception("Impossível criar dataset a partir de uma instrução SQL.", ex);
}
return ds;
}
That is the mistake:
the database I am using is Firebird
, but I think this is not the relevant thing, since searching only once, the research does not present error.
Your question is so confused... Does the error happen when you repeat the search? What other machines have to do with the question? You’ve already debugged your code?
– Leandro Angelo
why are you killing all the pool on
GetData()
– Leandro Angelo
makes a block using instantiating a new connection and closes it at the end
– Rovann Linhalis
Your code is already strange because it closes and opens connection, without you checking if it really is open, I see problems in it, the attached error with image in your question does not really say, you have to say where really happens this error in which line and when does all this, is a local error
– novic
besides q not seen q has to do with one code with the other
– Rovann Linhalis
Well, I’ll try to summarize here, I’m developing a web report. Apparently it’s giving conflict in the search functions. As this report can be used in more than one location, as in two different Pcs, it breaks down when I try to generate two reports at a time, even if with different information. I was wondering if there’s any way to leave those functions in an asynchronous way. If need be, put all the forms of research I have used, and how it was reported that those posted are incorrect, how can I correct them?
– Bruno Miqueas