Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
executescalar
- Page 1
ExecuteScalar requires an open and available Connection. The connection's current sta
Programming
Software Development
12 Years Ago
by abc88
…connection but it gives me the following error:
ExecuteScalar
requires an open and available Connection. The …Sub Main() try connection.open() cmd.
ExecuteScalar
() Check1() Check2() Catch() cmd.
ExecuteScalar
() Finally cmd.
ExecuteScalar
() <---- gives an error connection.…
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by MichaelWClark
…WHERE [PRODUCT_NAME] ='CellName'" [/code] The
ExecuteScalar
then returns the corresponding Product_Model from the DB. With…As New SqlCommand(SelectQuery, SQLConn) Dim RowCnt = SqlCom.
ExecuteScalar
() SQLConn.Close() SQLConn.Dispose() Dim res As String…
Re: ExecuteScalar requires an open and available Connection. The connection's current sta
Programming
Software Development
12 Years Ago
by GeekByChoiCe
… error message pops up: [CODE=vb] Try connection.open() cmd.
ExecuteScalar
() Check1() Check2() Catch(ex as Exception) MsgBox(ex.ToString) Finally…
ExecuteScalar requires an open and available Connection
Programming
Web Development
15 Years Ago
by cVz
…GetConnectionObject() ); try { // Reset the error object ClearError(); return (Int32)comm.
ExecuteScalar
(); <------- Error here } catch( SqlException ex ) { SetError( ex ); return -1…
ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by MichaelWClark
… in the other dropdown based upon results of
executeScalar
. If i have the catagory "Cellular"…SqlCom As New SqlCommand(SelectQuery, SQLConn) Dim RowCnt = SqlCom.
ExecuteScalar
() SQLConn.Close() SQLConn.Dispose() Dim res As String res…
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by finito
…As New SqlCommand(SelectQuery, SQLConn) Dim RowCnt = SqlCom.
ExecuteScalar
() SQLConn.Close() SQLConn.Dispose() Dim res As String…; + ddlProductName.SelectedValue + "'", SQLConn).
ExecuteScalar
().ToString SQLConn.Close() SQLConn.Dispose() [/CODE]
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by crishjeny
Hi [CODE] public static T ExecuteNullableScalar<T>(this SqlCommand cmd) where T : struct { var result = cmd.
ExecuteScalar
(); if (result == DBNull.Value) return default(T); return (T)result; }[/CODE]
ExecuteRedear vs ExecuteScalar
Programming
Web Development
17 Years Ago
by rajni11
I am having confusion in
ExecuteScalar
& ExecuteReader If we use ExecuteReader for select with aggregate … help of only one method ExecuteReader so why is there
ExecuteScalar
………, is there any other benefit of it? Please give the…
Re: ExecuteRedear vs ExecuteScalar
Programming
Web Development
17 Years Ago
by tgreer
… have to do a Read(), then get the value. [B]
ExecuteScalar
[/B] immediately returns the actual value. So, in terms of… retrieving Scalar data from a database, [B]
ExecuteScalar
[/B] is more efficient.
Re: ExecuteRedear vs ExecuteScalar
Programming
Web Development
17 Years Ago
by rajni11
… have to do a Read(), then get the value. [B]
ExecuteScalar
[/B] immediately returns the actual value. So, in terms of… retrieving Scalar data from a database, [B]
ExecuteScalar
[/B] is more efficient.[/QUOTE]
Re: ExecuteRedear vs ExecuteScalar
Programming
Web Development
15 Years Ago
by chan_lemo
follow the link below , it will explain
executescalar
and executereader. [url]http://vb.net-informations.com/ado.net-dataproviders/ado.net-
executescalar
-sqlcommand.htm[/url] [url]http://vb.net-informations.com/ado.net-dataproviders/ado.net-executereader-sqlcommand.htm[/url] lemo
Re: Error Retrieving Single Data Using ExecuteScalar Method
Programming
Software Development
15 Years Ago
by bruce2424
follow the url, it explain how to
ExecuteScalar
[url]http://vb.net-informations.com/ado.net-dataproviders/ado.net-
executescalar
-sqlcommand.htm[/url]
Error Retrieving Single Data Using ExecuteScalar Method
Programming
Software Development
17 Years Ago
by wonder_gal
… = New SqlCommand(sqlText, oConn) strSQLCmd.Connection.Open() [B]sd = strSQLCmd.
ExecuteScalar
(System.Data.CommandBehavior.CloseConnection)[/B] Return sd End Function [/code…
using executeScalar()
Programming
Software Development
14 Years Ago
by capiono
…", SqlDbType.Int, value); con.Open(); returnValue = Convert.ToInt32(cmd.
ExecuteScalar
()); [/CODE] for instance, if Plan_id is 1 it returns the…
Re: ExecuteScalar requires an open and available Connection
Programming
Web Development
15 Years Ago
by agrothe
First off, thats C# and not asp. This needs to be in the ASP.NET forum. Second, if it worked fine and then SQL Connect suddenly stops, check your database not your code. You probably have an offline SQL database.
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by dnanetwork
use ExecuteReaser() or ExecuteNonQuery()
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by finito
[QUOTE=dnanetwork]use ExecuteReaser() or ExecuteNonQuery()[/QUOTE] you mean ExecuteReader() ExecuteNonReader will not Return anything.
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by MichaelWClark
Update: Changed code to: If Not ddlProductName.SelectedValue = "-Select Product-" Then Dim SQLConn As New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString")) SQLConn.Open() Dim SqlCom As New SqlCommand("SELECT […
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by MichaelWClark
Okay so....NO Clue what was going on... I scripted out my DB from my SQL Express and put it onto a full version on my test VM and everything is working now....what a waste of time... ASP.net needs to impliment the error: ASP.NET Error Your SQL Server is lame. Thanks for the help all!
Re: ExecuteScalar() Only works once...?
Programming
Web Development
13 Years Ago
by dnanetwork
sorry i mean comm.ExecuteReader();
ExecuteScalar requires an open and available Connection. The connection's c
Programming
Web Development
10 Years Ago
by laura301019
I keep receiving this error and I'm unsure how to fix it. The code I have is protected void AddUserToDatabase(String username, String Password, String Email) { OleDbConnection conn; OleDbCommand cmd; using (conn = new OleDbConnection(ConfigurationManager.ConnectionStrings[&…
Re: ExecuteScalar requires an open and available Connection. The connection's c
Programming
Web Development
10 Years Ago
by pritaeas
Sounds like you need to open your connection, before using the command.
Re: ExecuteScalar requires an open and available Connection. The connection's c
Programming
Web Development
10 Years Ago
by aneri28
hii, write conn.Open() before "using (cmd = conn.CreateCommand())" line...bcz u r creating command using conn obj...which is not opened yet...
Re: using executeScalar()
Programming
Software Development
14 Years Ago
by sknake
The where condition of your query is wrong. Use: [icode]Where plan_id = [COLOR="Red"][B]@plan_id[/B][/COLOR][/icode] And: [icode]cmd.Parameters.Add("@plan_id", SqlDbType.Int, value);[/icode]
Re: Getting the Identity value from an inserted SQL Row
Programming
Software Development
8 Years Ago
by darkagn
ExecuteScalar
always returns a single value, so you should use it … need to handle DBNull.Value during your conversion when using
ExecuteScalar
, but in your specific example this probably won't be… query this would be overkill and I would just use
ExecuteScalar
instead.
Re: Getting the Identity value from an inserted SQL Row
Programming
Software Development
8 Years Ago
by Teme64
… SqlDbType.DateTime).Value = DateTime.Now; try { Conn.Open(); //
ExecuteScalar
() returns an object so assign it to a variable which… is of type object scalarObject = EventCommand.
ExecuteScalar
(); // If the returned object is of integer type …
Re: I have a problem with the datagrid
Programming
Software Development
12 Years Ago
by |-|x
ExecuteScalar
is for queries that return a single result, eg `SELECT …
Questions for Web Gurus! (*??*)
Programming
Web Development
16 Years Ago
by SheSaidImaPregy
… conPubs ) Dim intID1 As Integer = cmdSelect.
ExecuteScalar
() cmdSelect = New OdbcConnection( "SELECT OOPS… = cmdSelect4.
ExecuteScalar
() intOops1 = cmdSelect5.
ExecuteScalar
() intID2 = cmdSelect6.
ExecuteScalar
() intOops2 = cmdSelect7.
ExecuteScalar
() intID3 = cmdSelect8.
ExecuteScalar
() intOops3 cmdSelect9.
ExecuteScalar
() conPubs.Close…
Problem With a Function
Programming
Web Development
14 Years Ago
by ctyokley
…As Object obj = sqlcommand.
ExecuteScalar
() obj2 = sqlcommand2.
ExecuteScalar
() obj3 = sqlcommand3.
ExecuteScalar
() If obj Or obj2 …As Object obj = sqlcommand.
ExecuteScalar
() obj2 = sqlcommand2.
ExecuteScalar
() obj3 = sqlcommand3.
ExecuteScalar
() If obj Or obj2 …
My first vb.net function - and I'm stuck
Programming
Software Development
14 Years Ago
by Levhai
… conn2.Open() newPhoneCheck = Convert.ToString(cmdPhoneIDcheck.
ExecuteScalar
) If newPhoneCheck = "" Then… conn2.Open() newPhoneCheck = Convert.ToString(cmdPhoneIDcheck.
ExecuteScalar
) Do Until newPhoneCheck <> newPhoneID …
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