C
C#β€’3y ago
Mayor McCheese

βœ… display data from database

There's a lot to unpack there, across multiple disciplines. What have you tried so far?
60 Replies
Mayor McCheese
Mayor McCheeseOPβ€’3y ago
Are you willing to use ef core for instance? What is a webform? Literally webforms? 1. Start project 2. Build models 3, add ef core context 4. Determine web tech ... There's a lot to unpack past 4
Angius
Angiusβ€’3y ago
>webforms My condolences
PANZER
PANZERβ€’3y ago
I don't know how do I explain, like do I share my code?? , So you'll understand what I am asking for exactly
Angius
Angiusβ€’3y ago
I mean, sure I guess the main confusion though is that you mentioned "webform" Since Webforms is a dead pile of shit technology that nobody sane has used for the past decade
Mayor McCheese
Mayor McCheeseOPβ€’3y ago
Still maintained more than wpf
what have you tried so far
Go for $code
MODiX
MODiXβ€’3y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
PANZER
PANZERβ€’3y ago
BlazeBin - bntcfgcvrxnq
A tool for sharing your source code with the world!
PANZER
PANZERβ€’3y ago
i tried the grid but an error always occurs i also did the web.config like providing the connection string <connectionStrings> <add name="master" connectionString="Data Source=(localdb)\Local;Integrated Security=True;"/> </connectionStrings> @Mayor McCheese
JakenVeina
JakenVeinaβ€’3y ago
welp, that literally is actual WebForms first step then is to stop using WebForms, unless you are being absolutely forced to. Barring that, you say an error occurs. What error?
PANZER
PANZERβ€’3y ago
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server. @ReactiveVeina
JakenVeina
JakenVeinaβ€’3y ago
what's the URL?
Denis
Denisβ€’3y ago
oof
PANZER
PANZERβ€’3y ago
you mean this 'https://localhost:44391/'
JakenVeina
JakenVeinaβ€’3y ago
A default document is not configured for the requested URL
what URL is being requested that has no default document
PANZER
PANZERβ€’3y ago
maybe this
JakenVeina
JakenVeinaβ€’3y ago
that's a connection string so, no
PANZER
PANZERβ€’3y ago
Smadge
JakenVeina
JakenVeinaβ€’3y ago
what URL gives you this error?
PANZER
PANZERβ€’3y ago
@ReactiveVeina
JakenVeina
JakenVeinaβ€’3y ago
k so, you're trying to visit the default document and there isn't one what's your intention here?
PANZER
PANZERβ€’3y ago
to display the database table on the webpage @ReactiveVeina
JakenVeina
JakenVeinaβ€’3y ago
what webpage
PANZER
PANZERβ€’3y ago
the one i made this is my code @ReactiveVeina
JakenVeina
JakenVeinaβ€’3y ago
stop pinging me and what is the URL for that page
PANZER
PANZERβ€’3y ago
ok πŸ˜“ the same thats giving the error
JakenVeina
JakenVeinaβ€’3y ago
no it's obvoiously not otherwise you wouldn't be getting that error
PANZER
PANZERβ€’3y ago
i mean this is on localdb not on web so..
JakenVeina
JakenVeinaβ€’3y ago
what does localdb have to do with this?
PANZER
PANZERβ€’3y ago
πŸ˜“ can you pls explain it to me!
JakenVeina
JakenVeinaβ€’3y ago
if I could, I would I need info from you what do you need explained?
PANZER
PANZERβ€’3y ago
what do you mean URL of that page ?
JakenVeina
JakenVeinaβ€’3y ago
the URL that you visit with a browser to reach the page websites consist of pages that are served up to browsers by an HTTP server pages are identified by their URL navigating to a URL within a browser involves the browser sending an HTTP request to the server identified by the URL, and the server looking at the URL to determine which page should be returned, and then returning it
PANZER
PANZERβ€’3y ago
Ok here me out The code above before I added the grid , it opened up the webpage the form that I made , now I wanted to display the database beside the webform , after I did the grid and set up the link with db , it leads me to this error l, hence the URL you are asking is the same that's giving the error. (This is what I understood, I could be wrong 🫠)
JakenVeina
JakenVeinaβ€’3y ago
adding a grid to the ASPX file for this page has 0 bearing on how requests are routed to the page or not something else got screwed up in the meantime don't suppose you're using source control?
PANZER
PANZERβ€’3y ago
no whats that?
JakenVeina
JakenVeinaβ€’3y ago
the thing that would let you see exactly what changes you've made to the code since the last time this works so you could find the accidental change you made alright, uhhhh where is this file, then? in the project?
PANZER
PANZERβ€’3y ago
the code i have above is the present one
JakenVeina
JakenVeinaβ€’3y ago
oaky and where is that file
PANZER
PANZERβ€’3y ago
i do have the code before the error occured
JakenVeina
JakenVeinaβ€’3y ago
okay, then! what's changed since then?
PANZER
PANZERβ€’3y ago
i cant figure out https://paste.mod.gg/bntcfgcvrxnq/0 its in beforeerror, can you pls check
BlazeBin - bntcfgcvrxnq
A tool for sharing your source code with the world!
PANZER
PANZERβ€’3y ago
in favorite sets i am pinging you incase you left the chatπŸ˜… @ReactiveVeina
JakenVeina
JakenVeinaβ€’3y ago
if I did, pinging me isn't going to bring me back it's just going to annoy me so, why do you keep linking me to the same file? where the problem isn't as if I haven't looked at it already like the first time not to mention the 5 more there is no "beforeerror" in that file
PANZER
PANZERβ€’3y ago
in here
JakenVeina
JakenVeinaβ€’3y ago
that's not the blazebin you keep linking me to I can see the URL there rwp something you keep linking me to bnt something
PANZER
PANZERβ€’3y ago
BlazeBin - rwpqaehqdhdy
A tool for sharing your source code with the world!
PANZER
PANZERβ€’3y ago
sorry did you got the beforeerror file?
JakenVeina
JakenVeinaβ€’3y ago
so, what changed here? oh, I see what you're saying uhh it seems like you changed the filename? except also not? you've labeled half of this as WebForm1.aspx and the other half as WebForm2.aspx.cs other than that, nothing here affects the routing for this page, like I said earlier
PANZER
PANZERβ€’3y ago
it is solved it was because of the database name
JakenVeina
JakenVeinaβ€’3y ago
in the connection string?
PANZER
PANZERβ€’3y ago
yes
JakenVeina
JakenVeinaβ€’3y ago
gonna have to disagree with you
PANZER
PANZERβ€’3y ago
what! ??
JakenVeina
JakenVeinaβ€’3y ago
the connection string you're using to connect to a database has 0 bearing on how routing works in your application you are receiving a routing error according to you anyway
PANZER
PANZERβ€’3y ago
in web.config
JakenVeina
JakenVeinaβ€’3y ago
I would buy that there's a different part of the Web.config that caused the issue and you inadvertently fixed it at the same time as fixing the connection string
PANZER
PANZERβ€’3y ago
now that i am done with my query, how to i close this post
JakenVeina
JakenVeinaβ€’3y ago
add a green checkmark reaction to it, I think?
PANZER
PANZERβ€’3y ago
Ok done
JakenVeina
JakenVeinaβ€’3y ago
yeah, I don't know then apparently it's /close

Did you find this page helpful?