Hello friends
I have a datagridview in my project that will show the resault of one storedprocedure.when I execute storedprocedure,It works correctly but when I call it through the program datagridview doesn't show anything.I used break point to find the problem but every thing was ok.
So what's the problem?
thx for your attention.

Recommended Answers

All 5 Replies

Do you have access to execute the stored procedure and are you referencing the same procedure? Make the call to exec dbo.SomeProcedureName to ensure you're calling the dbo's version of it.

Other than that -- I have no idea. You didn't explain your problem very well :(

I used service-based database component in my project and create store procedures in it. other store procedures work well.
what do you mean by calling exec dbo.SomeProcedureName.(of course i have exec in my store procedures)
If there is something unclear in my question let me know to explain it.
thank you

I'm not sure what you mean: "service-based database component" .. "and create store procedures in it"?

Dajer,
You have a local database with .\SQLEXPRESS. We have not enough expertise to guess the problems you are facing. Post some code.

SqlDataAdapter adp=new SqlDataAdapter("select * from Table",@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\csnet\Database1.mdf;Integrated Security=True;User Instance=True");
DataTable dt=new DataTable();

dataGridView1.DataSource=dt;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.