Wondering if anyone can help me with this. I have a query that returns results just fine in MSSQL, however when I run it in my code, it returns 0 rows. Here's the query:
SELECT m.Email FROM o.dbo.mem m, o.dbo.roleKey u, o.dbo.role r WHERE r.RoleName = 'Member' AND r.rid = u.rid AND u.uid = m.uid
And in the code:
cmd.CommandText = "SELECT m.Email FROM o.dbo.mem m, o.dbo.roleKey u, o.dbo.role r WHERE r.RoleName = 'Member' AND r.rid = u.rid AND u.uid = m.uid";
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
Object rowsR = cmd.ExecuteNonQuery();
SqlDataReader reader = cmd.ExecuteReader();
sqlConnection1.Close();
rowsR returns -1. Again, the query works when I run it in MSSQL.
I tried to re-write it with joins, so here is it rewritten a different way, however this doesn't work either. I had to hard code the role values, so I'd prefer to simply fix the first way.
SELECT m.Email FROM o.dbo.mem M JOIN o.dbo.roleKey U ON M.uid = U.uid WHERE rid = 'Key1' OR rid = 'Key2'
I'm really new to Visual Studios. I used Visual Basic about 6 years ago in High School, and have been thrown into Visual Studios in order for this semester long project. So, I may be over looking something incredibly simple, but I'm learning it as I go along.
I also understand that the database isn't set up in the best way, but it's what I've been given and I can't change the structure at this point.
Agreed. And this is a great discount offer!
It's a shame that there's no discount offer option for people who would be fine subscribing for a year-long term, but pay monthly.
A Warhammer 40K racing game and a chess roguelike are free to claim on the Epic Games Store by Pulasthi Ariyasinghe
The Epic Games Store has returned to its standard giveaway procedures after weeks of mystery freebies. The latest drop is replacing last week's Rogue Waters and Songs of Conquest games and has brought in a double giveaway offering Warhammer 40K Speed Freeks and The Ouroboros King. As always, the game is yours to add permanently to your Epic Games Store library within the next seven days.
From the duo, Warhammer 40K Speed Freeks lands from developer Caged Element, and it's a racing game that was only released last year. The title has you piloting Ork buggies, tanks, and aircraft modeled after the popular tabletop miniatures. The focus is on multiplayer mayhem, offering multiple game modes that have you fighting other players as everyone tries to survive and get across finish lines or destroy mechs.
Crossplay support between PC and consoles has now arrived as part of a free update, too, giving a boost to matchmaking times for this multiplayer-focused title.
If racing carnage isn't your thing, then The Ouroboros King offers tactics. The indie title is a mashup of chess and standard roguelike experience, letting players create their own armies to defeat an enemy faction, all on the familiar checkered board. There is a procedurally generated map, pieces with special abilities, relics that bend the game's rules to make overpowered builds, and more.
The newly available Warhammer 40K Speed Freeks and The Ouroboros King giveaways on the Epic Games Store are set to run until June 11, giving PC gamers seven days to claim the latest offer. Once this closes out, a new freebie will take its place on the same day.
Don't forget that mobile gamers can check out the Epic Game Store's weekly giveaways on Android and iOS to grab a freebie there as well.
Geforce Now is great! Playing with a 4080/5080 without spending over $1k Just for the Gpu..plus other componentes.
Finished resident evil 9 (running rtx 5080) on a mac mini m2.
The mini is the size of just the gpu. No more bulky Pc towers on my desk
Question
Hendrick
Hi-
Wondering if anyone can help me with this. I have a query that returns results just fine in MSSQL, however when I run it in my code, it returns 0 rows. Here's the query:
And in the code:
rowsR returns -1. Again, the query works when I run it in MSSQL.
I tried to re-write it with joins, so here is it rewritten a different way, however this doesn't work either. I had to hard code the role values, so I'd prefer to simply fix the first way.
I'm really new to Visual Studios. I used Visual Basic about 6 years ago in High School, and have been thrown into Visual Studios in order for this semester long project. So, I may be over looking something incredibly simple, but I'm learning it as I go along.
I also understand that the database isn't set up in the best way, but it's what I've been given and I can't change the structure at this point.
Any help is GREATLY appreciated.
Thanks!
Edited by HendrickLink to comment
https://www.neowin.net/forum/topic/1135378-visual-studios-c-query-fail/Share on other sites
2 answers to this question
Recommended Posts