Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
sqlcommand
- Page 1
SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by Schol-R-LEA
… conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ServicePro"].ConnectionString);
SqlCommand
command = new
SqlCommand
("SetClientEmail", conn); command.CommandType = CommandType.StoredProcedure; SqlParameter…
Re: SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by Schol-R-LEA
… the parameters do show up (apparently correctly) in the [ICODE]
SQlCommand
[/ICODE] object when I watch it in the debugger, and…
Re: SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by Schol-R-LEA
… parameter in question is in fact being added to the
SqlCommand
. I don't see how using an array would make…
Hashtables function not working with SqlCommand parameters?
Programming
Software Development
12 Years Ago
by kolibrizas
[CODE]
SqlCommand
command = new
SqlCommand
("SELECT Id FROM users WHERE Username=@Username AND…pieces[2]);[/CODE] doesn't return correct result [CODE]
SqlCommand
command = new
SqlCommand
("SELECT Id FROM users WHERE Username=@Username AND…] Maybe there is a way to check how the
SqlCommand
looks once with parameters added or other way to check…
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
…SqlConnection connection = new SqlConnection(Settings.Default.ConnectionString);
SqlCommand
command = new
SqlCommand
(sql, connection); if (args != null) command…Append(","); } } sb.Append(SqlStrSelectTimePart2);
SqlCommand
SqlCmd = new
SqlCommand
(); SqlCmd.CommandText = sb.ToString(); SqlCmd.Parameters.Add…
Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
… problem when trying to convert my sql-query to a
SqlCommand
. The query: [CODE] SELECT L1.[App_Name], DATEDIFF(ss,MAX(L1… the query via a config-file. [CODE]private
SqlCommand
CreateSQLCommand(int i) {
SqlCommand
SqlCmd = new
SqlCommand
(); //SqlCmd.CommandText = SqlStrSelectTime; SqlCmd.CommandText = "SELECT…
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
… don't get a query response. :( [CODE]private
SqlCommand
CreateSQLCommand(int i) {
SqlCommand
SqlCmd = new
SqlCommand
(); //SqlCmd.CommandText = SqlStrSelectTime; SqlCmd.CommandText = "SELECT…
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by privatevoid
… SqlParameter[] args) { SqlConnection connection = new SqlConnection(Settings.Default.ConnectionString);
SqlCommand
command = new
SqlCommand
(sql, connection); if (args != null) command.Parameters.AddRange(args…
passing empty string to SqlCommand.Parameter.Add
Programming
Software Development
18 Years Ago
by baba0880
…,engDesc,frDesc) VALUES (@key,@english,@french)" Dim cmd As
SqlCommand
= SqlConnection1.CreateCommand cmd.Parameters.Add("@key", txtKey.Text…
Going to new line (sqlcommand class)_
Programming
Software Development
10 Years Ago
by castajiz_2
cmd = new
SqlCommand
("select beggining_school, end_school FROM Student,student_weekend,Weekend WHERE Student.…
Re: SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by stbuchok
Have you tried running the stored procedure in SSMS (SQL Server Management Studio) to see if it is the stored procedure?
Re: SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by aspproject
you missed writing number of parameters ... write code like SqlParameter[] ISqlPara = new SqlParameter[2]; ISqlPara[0] = new SqlParameter("@NewsID", NewsID); ISqlPara[1] = new SqlParameter("@newsname", Newsname);
Re: SqlCommand not accepting SqlParameter
Programming
Web Development
12 Years Ago
by NETProgrammer
You can try something like this [CODE]command.Parameters.Add("@AccountKey", SqlDbType.Int).Value = accountKey;[/CODE] Repeat this for all of your parameters.
Database attempt to retrieve all column name
Programming
Web Development
10 Years Ago
by gahhon
SqlCommand
cmdColumnName = new
SqlCommand
("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='DailyBudget' ORDER …
Re: Hashtables function not working with SqlCommand parameters?
Programming
Software Development
12 Years Ago
by thines01
Do you need to cast the return value from the Hastable as a string, first (like pieces[1].ToString())? Can you use a Dictionary<int, string> instead?
Re: Hashtables function not working with SqlCommand parameters?
Programming
Software Development
12 Years Ago
by kolibrizas
I did solve this myself, the problem being wrong base encoding, not the problem in my code itself. Can I delete this topic somehow?
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Sodabread
I'm not 100% on this, but shouldn't your inAppId variable be a stringbuilder or something similar? Right now, you're trying to add a List as a varchar and I didn't think that would implicitly convert correctly.
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Sodabread
Hmm. When you return that SQL command, are you associating it with a connection object? Also, how are you executing the query?
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
[QUOTE=Sodabread;1194359]Hmm. When you return that SQL command, are you associating it with a connection object? Also, how are you executing the query?[/QUOTE] Yes I do, if I remove the "in" part of the query everything works fine... [CODE]sqlcmd.Connection = SQLConnection; SqlDataAdapter SQLDataAdapter = new SqlDataAdapter(sqlcmd…
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Sodabread
Let's try this. When you create your stringbuilder, you immediately append a double apostrophe and then a comma. I'm wondering if an empty set of apostrophes is causing issues. For curiosity's sake, try this: [CODE] StringBuilder inAppId = new StringBuilder(); for(int j = 0; j < ServiceList.Count; j++) { inAppId.Append("'" + …
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
[QUOTE=Sodabread;1194614]Let's try this. When you create your stringbuilder, you immediately append a double apostrophe and then a comma. I'm wondering if an empty set of apostrophes is causing issues. For curiosity's sake, try this: [CODE] StringBuilder inAppId = new StringBuilder(); for(int j = 0; j < ServiceList.Count; j++) { …
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by privatevoid
Thats fine aslong as the app_names are not editable outside the code as this will leave a security vulnerability.
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
[QUOTE=privatevoid;1195260]Thats fine aslong as the app_names are not editable outside the code as this will leave a security vulnerability.[/QUOTE] I fetch them from a database, so they should be safe.
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Sodabread
Good catch, void. I think I need to up my C# knowledge a bit.
Re: Help with SqlCommand
Programming
Software Development
14 Years Ago
by Gospp
I think we've come as far as we are going to get. Thanks for your help, both of you!! :)
Re: passing empty string to SqlCommand.Parameter.Add
Programming
Software Development
18 Years Ago
by baba0880
Error Message Prepared statement '(@key char(10),@english char(40),@french char(40)) INSERT expects parameter @english,which was not supplied
Re: passing empty string to SqlCommand.Parameter.Add
Programming
Software Development
18 Years Ago
by baba0880
cmd.Parameters.Add("@key", SqlDbType.Char).Value = IIf(txtKey.Text = String.Empty, DBNull.Value, txtKey.Text)
Re: Going to new line (sqlcommand class)_
Programming
Software Development
10 Years Ago
by deceptikon
Two options. One is a verbatim string: var query = @"select beggining_school, end_school FROM Student,student_weekend,Weekend WHERE Student.ID=student_weekend.studentID AND student_weekend.WeekendID=Weekend.ID" Note that indentation is significant in the string, as are newlines. The other, my preference, is literal …
Re: Database Update Failure.
Programming
Web Development
10 Years Ago
by gahhon
SqlCommand
cmdUpdateTransaction = new
SqlCommand
(String.Format("UPDATE DailyBudget SET {0}=@amount WHERE (Username=@username AND Date=@date)", txtCategory.Text), conAddTransaction); is said my `=` got problem. Please advise me. Thanks a lot.
Re: Dispose in asp.net
Programming
Software Development
14 Years Ago
by Ramy Mahrous
SqlCommand
inherits from DBCommand which inherits from Component Component has this …
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC