CommandText

Jul 27, 2006

Dim MiSQL As String = "INSERT INTO tabla1(ID,Proveedor,Tipo) VALUES (@IDCentro,@Proveedor,@Tipo)"

................

cm.Parameters.Add(New SqlParameter("@IDCentro", SqlDbType.Int, 4)).Value = 15

cm.Parameters.Add(New SqlParameter("@Proveedor", SqlDbType.NVarChar, 50)).Value = "IBM"

cm.Parameters.Add(New SqlParameter("@Tipo", SqlDbType.TinyInt, 1)).Value = 35


Hi friens, its possible to get the string with the vaules of parameters changed?, i mean get this string in code:

INSERT INTO tabla1(ID,Proveedor,Tipo) VALUES (15,IBM,35);

I tried with CommandText but in this string are the variables and not the values....thx a lot.

View 1 Replies


ADVERTISEMENT

CommandText With A Unicode Variable

Apr 29, 2008

PRAdapter.SelectCommand.CommandText = "SELECT * FROM dbo.Customer WHERE Cname = 'بهمن' ";PRAdapter.Fill(table); 
The table in the DataBase has a complete row contains this column.
But count of rows of the table in C# is 0 (zero).
I don't know why.
Thanks for your answer!

View 2 Replies View Related

ADODB CommandText Length

Sep 27, 2007

Hi,

I am trying to write a Macro in Excel which would connect to the database and fetch the data for me.

I am using a SQL Query and pass it to a ADODB Command object as adCmdText. The SQL Query is very big, length could be 2500 characters.

I just have read access to the database and do not have a choice to create a Stored Procedure to return a resultset.


When i try to open a recordset with the query, i get a Automation Error.

Is there a Limit on the length of the string i can pass as CommandText?

Regards,
Vikram

View 4 Replies View Related

Replacing Variable In Commandtext Fails?!?

Sep 12, 2006

Strangest thing is happening...Im building a select query..when I execute the query I get the results I want...But then I add the following code (yes am assigning the cmdText to myCommand etc, that all works):cmdText += "LookingForIDs LIKE '%,@LFID,%' "mycommand.Parameters.Add(New SqlParameter("@LFID", s(i)))(I used the debugger and this code is executed)the s() is an array of String.Now..I would expect that the @LFID part is replaced with the value of s(i)..in this case it's "2"Now when I execute the query...no results are found anymore....BUT when I execute the query in MS SQL Management Studio and replaced the @LFID manually with "2" it DOES work...and returns the right resultsAlso when I replaced the @LFID in the code with 2 so that it becomes:cmdText += "LookingForIDs LIKE '%,2,%' " it works....So my best guess is that for SOME reason the @LFID doesnt get replaced

View 4 Replies View Related

ExecuteNonQuery: CommandText Property Has Not Been Initialized

May 21, 2007

Hi ,
     Iam new to vs2005. Iam trying to integrate  Authorize.net for transactions in my site. When i tested it worked fine .But when i put it in live for Amex cards it is giving me sqlerror.
Here is my code
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Net;
using System.IO;
public partial class Paymentprocessing : System.Web.UI.Page
{SqlConnection objConn = new SqlConnection(ConfigurationManager.AppSettings["strConn"]);
string permLevel = "";protected void Page_Load(object sender, EventArgs e)
{if (Session["displayname"] == null || Session["franchiseid"] == null || Session["username"] == null)
{Response.Redirect("Default.aspx");
}
else
{lblusrname.Text = Session["displayname"].ToString();
}string strSelectquery = "";
strSelectquery = "select userPermissionLevel,Franchise_ID from tblUsers where User_Name='" + Session["username"].ToString()+"'";SqlCommand objCmd = new SqlCommand(strSelectquery, objConn);SqlDataReader objDr;
objConn.Open();
objDr = objCmd.ExecuteReader();
 if (objDr.Read())
{
permLevel = objDr[0].ToString();
}
objDr.Close();
objConn.Close();if (int.Parse(permLevel) == 99)
{pnlRefundCC.Visible = true;
pnlRefundCA.Visible = true;pnlTransact.Visible = true;
pnlPaymentInfo.Visible = true;pnlCardifo.Visible = true;
}
else
{pnlPaymentInfo.Visible = true;
pnlCardifo.Visible = true;pnlRefundCC.Visible = false;
pnlRefundCA.Visible = false;pnlTransact.Visible = false;
}
}protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{pnlTransact.Visible = false;
pnlPaymentCCA.Visible = false;pnlOrgTransID.Visible = true;pnlCardifo.Visible = true;
 
}protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{pnlOrgTransID.Visible = false;pnlPaymentCCA.Visible = false;
}protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
pnlPaymentInfo.Visible = false;pnlTransact.Visible = false;
pnlPaymentCCA.Visible = true;pnlDriversCCA.Visible = true;
}protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
{pnlPaymentInfo.Visible = true;
pnlTransact.Visible = false;pnlOrgTransID.Visible = true;
pnlCardifo.Visible = false;pnlPaymentCCA.Visible = true;pnlDriversCCA.Visible = false;
}protected void btnSubmit_Click(object sender, EventArgs e)
{
string strSelect = "";strSelect = "select franchiseAuthNetID,franchiseAuthNetKey from franchises where franchiseid=" + Session["franchiseid"];
SqlCommand objCmd = new SqlCommand(strSelect, objConn);SqlDataReader objDr;
objConn.Open();
objDr = objCmd.ExecuteReader();String x_login = "";
String x_tran_key = "";if (objDr.Read())
{
x_login = objDr[0].ToString();
x_tran_key = objDr[1].ToString();
}
objDr.Close();
objConn.Close();
 /***************************************************************
VARIABLES USED THROUGHOUT THIS SCRIPT
**************************************************************/String x_version = "3.1";
String x_test_request = "false"; // needs to be set to false when in productionString x_delim_data = "true";
String x_delim_char = "|";String x_relay_response = "false";
String x_first_name = txtFirstname.Text;String x_last_name = txtLastname.Text;
String x_company = txtCompany.Text;String x_address = txtAddress.Text;
String x_city = txtCity.Text;String x_state = txtState.Text;
String x_zip = txtZip.Text;String x_country = txtCountry.Text;
String x_phone = txtPhone.Text;String x_fax = txtFax.Text;
String x_cust_id = "";String x_customer_ip = Request.ServerVariables["REMOTE_ADDR"];
String x_customer_tax_id = txtTaxid.Text;String x_email = txtEmail.Text;
String x_email_customer = "true";String x_merchant_email = "help@XYZ.com";
String x_invoice_num = txtInvoiceno.Text;String x_description = txtInvoicedesc.Text;
String x_ship_to_first_name = "";String x_ship_to_last_name = "";
String x_ship_to_company = "";String x_ship_to_address = "";
String x_ship_to_city = "";String x_ship_to_state = "";
String x_ship_to_zip = "";String x_ship_to_country = "";if (CheckBox1.Checked)
{
x_ship_to_first_name = txtFirstname.Text;
x_ship_to_last_name = txtLastname.Text;
x_ship_to_company = txtCompany.Text;
x_ship_to_address = txtAddress.Text;
x_ship_to_city = txtCity.Text;
x_ship_to_state = txtState.Text;
x_ship_to_zip = txtZip.Text;
x_ship_to_country = txtCountry.Text;
}
else
{
x_ship_to_first_name = txtShippingfirstname.Text;
x_ship_to_last_name = txtShippinglastname.Text;
x_ship_to_company = txtShippingcompany.Text;
x_ship_to_address = txtShippingaddress.Text;
x_ship_to_city = txtShippingcity.Text;
x_ship_to_state = txtShippingstate.Text;
x_ship_to_zip = txtShippingzip.Text;
x_ship_to_country = txtShippingcountry.Text;
}String x_amount = "";
String x_method = "";if (RadioButton1.Checked == true || RadioButton3.Checked == true)
{
x_amount = txtAmount.Text;x_method = "CC";
}else if (RadioButton2.Checked == true || RadioButton4.Checked == true)
{
x_amount = txtCCAamount.Text;x_method = "ECHECK";
}String x_currency_code = "USD";
String x_type = "";if (int.Parse(permLevel) == 99)
{if (RadioButton5.Checked == true)
{x_type = "AUTH_CAPTURE";
}if (RadioButton6.Checked == true)
{x_type = "AUTH_ONLY";
}if (RadioButton7.Checked == true)
{x_type = "CAPTURE_ONLY";
}
}
else
{x_type = "AUTH_CAPTURE";
}String x_recurring_billing = "NO";
String x_bank_aba_code = txtRoutingno.Text;String x_bank_acct_num = txtAccno.Text;
String x_bank_acct_type = DropDownList1.SelectedValue;String x_bank_name = txtBankname.Text;
String x_bank_acct_name = txtNameonbankacc.Text;String x_echeck_type = "";
String x_customer_organization_type = "";if (DropDownList1.SelectedValue == "BUSINESSCHECKING")
{x_echeck_type = "CCD";
x_customer_organization_type = "B"; // business
}
else
{x_echeck_type = "WEB";
x_customer_organization_type = "I"; //individual
}
 String x_card_num = txtCardno.Text;
String x_exp_date = txtExpdate.Text;String x_card_code = "";
String x_trans_id = txtorgtransid.Text;String x_auth_code = "";
String x_authentication_indicator = "";String x_cardholder_authentication_value = "";
String x_drivers_license_num = txtDriverlicenseno.Text;String x_drivers_license_state = txtDriverlicensestate.Text;
String x_drivers_license_dob = txtDriverlicenseDOB.Text;/*************************************************************
Level 2 Data
*************************************************************/String x_po_num = "";
String x_tax = "";String x_tax_exempt = "";
String x_freight = "";String x_duty = "";
//*************************************************************/**************************************************************
Optional: You can also supply merchant-defined values.
**************************************************************/String my_own_variable_name = "";
String another_field_name = "";string strInsert = "";
string cashpay = "";string nocharge = "";string billcustomer = "";
 
 if (!CheckBox2.Checked)
{
 /**************************************************************
REQUEST STRING THAT WILL BE SUBMITTED BY WAY OF
THE HTTPS POST OPERATION
**************************************************************/String strPost = "x_login=" + x_login + "&x_tran_key=" + x_tran_key + "&x_version=" + x_version + "&x_method=" + x_method;
strPost = strPost + "&x_test_request=" + x_test_request + "&x_delim_data=" + x_delim_data + "&x_delim_char=" + x_delim_char;strPost = strPost + "&x_relay_response=" + x_relay_response + "&x_first_name=" + x_first_name + "&x_last_name=" + x_last_name + "&x_company=" + x_company + "&x_address=" + x_address;
strPost = strPost + "&x_city=" + x_city + "&x_state=" + x_state + "&x_zip=" + x_zip + "&x_country=" + x_country + "&x_phone=" + x_phone + "&x_fax=" + x_fax;strPost = strPost + "&x_cust_id=" + x_cust_id + "&x_customer_ip=" + x_customer_ip + "&x_customer_tax_id=" + x_customer_tax_id + "&x_email=" + x_email;
strPost = strPost + "&x_email_customer=" + x_email_customer + "&x_merchant_email=" + x_merchant_email + "&x_invoice_num=" + x_invoice_num + "&x_description=" + x_description;strPost = strPost + "&x_ship_to_first_name=" + x_ship_to_first_name + "&x_ship_to_last_name=" + x_ship_to_last_name + "&x_ship_to_company=" + x_ship_to_company;
strPost = strPost + "&x_ship_to_address=" + x_ship_to_address + "&x_ship_to_city=" + x_ship_to_city + "&x_ship_to_state=" + x_ship_to_state;strPost = strPost + "&x_ship_to_zip=" + x_ship_to_zip + "&x_ship_to_country=" + x_ship_to_country + "&x_amount=" + x_amount;
strPost = strPost + "&x_currency_code=" + x_currency_code + "&x_method=" + x_method + "&x_type=" + x_type + "&x_recurring_billing=" + x_recurring_billing;strPost = strPost + "&x_bank_aba_code=" + x_bank_aba_code + "&x_bank_acct_num=" + x_bank_acct_num + "&x_bank_acct_type=" + x_bank_acct_type;
strPost = strPost + "&x_bank_name=" + x_bank_name + "&x_bank_acct_name=" + x_bank_acct_name + "&x_echeck_type=" + x_echeck_type + "&x_card_num=" + x_card_num;strPost = strPost + "&x_exp_date=" + x_exp_date + "&x_card_code=" + x_card_code + "&x_trans_id=" + x_trans_id + "&x_auth_code=" + x_auth_code;
strPost = strPost + "&x_authentication_indicator=" + x_authentication_indicator + "&x_cardholder_authentication_value=" + x_cardholder_authentication_value;strPost = strPost + "&x_customer_organization_type=" + x_customer_organization_type + "&x_drivers_license_num=" + x_drivers_license_num;
strPost = strPost + "&x_drivers_license_state=" + x_drivers_license_state + "&x_drivers_license_dob=" + x_drivers_license_dob + "&my_own_variable_name=" + my_own_variable_name;strPost = strPost + "&another_field_name=" + another_field_name + "&x_po_num=" + x_po_num + "&x_tax=" + x_tax + "&x_tax_exempt=" + x_tax_exempt; strPost = strPost + "&x_freight=" + x_freight + "&x_duty=" + x_duty + "&x_customer_organization_type=" + x_customer_organization_type;
//Response.Write(strPost);
//Response.End();String result = ""; StreamWriter myWriter = null;
// HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create("https://test.authorize.net/gateway/transact.dll");HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create("https://secure.authorize.net/gateway/transact.dll");objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;objRequest.ContentType = "application/x-www-form-urlencoded";
try
{myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}catch (Exception ex)
{
Response.Write(ex.Message);
}
finally
{
myWriter.Close();
}HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}string[] strname = new string[1000];
strname = result.Split("|".ToCharArray());if (strname[0].ToString() == "2")
{Response.Write("Your Transaction Was Denied!" + "<br>");
}if (strname[0].ToString() == "3")
{Response.Write("Error Submitting Transaction" + "<br>");
}if (strname[0].ToString() == "1")
{
// Response.Write("Your Transaction Was Approved!" + "<br>");string cardno = "";
string accno = "";if (x_card_num != "")
{int intcardLen = x_card_num.Length;
cardno = x_card_num.Substring(intcardLen - 4, 4);
}
else
{cardno = "";
}if (x_bank_acct_num != "")
{int intLen = x_bank_acct_num.Length;
accno = x_bank_acct_num.Substring(intLen - 4, 4);
}
else
{accno = "";
}
 if (CheckBox2.Checked)
{cashpay = "1";
}
else
{cashpay = "0";
}
 if (CheckBox3.Checked)
{nocharge = "1";
}
else
{nocharge = "0";
}
 if (CheckBox4.Checked)
{billcustomer = "1";
}
else
{billcustomer = "0";
}strInsert = "Insert into transactions(franchiseid,transdate,transowner,transamount,transPaymentMethod,transCardNumber,transExpirationDate,transRoutingNumber,transAccountNumber,transBankName,transNameOnBankAccount,transBankAccountType,transDispatchNumber,transDescription,transBillingFirstName,transBillingLastName,";
strInsert = strInsert + "transBillingCompany,transBillingAddress,transBillingCity,transBillingState,transBillingZip,transBillingCountry,transBillingPhone,transBillingFax,transBillingEmail,transShippingFirstName,transShippingLastName,transShippingAddress,transShippingCity,transShippingState,transShippingZip,transShippingCountry,transCashpayment,transNocharge,transBillcustomer,transtimeinn,transtimeout)";strInsert = strInsert + "values (" + Session["franchiseid"] + ",'" + DateTime.Now.ToString() + "','" + Session["username"].ToString().Replace("'", "''") + "','" + strname[9].ToString() + "','" + x_method + "','" + "************" + cardno + "','" + x_exp_date + "','" + x_bank_aba_code + "','" + "*****" + x_bank_acct_num + "','" + x_bank_name.Replace("'", "''") + "','" + x_bank_acct_name.Replace("'", "''") + "','" + x_bank_acct_type + "','" + x_invoice_num + "','" + x_description.Replace("'", "''") + "','" + x_first_name.Replace("'", "''") + "','" + x_last_name.Replace("'", "''") + "','" + x_company.Replace("'", "''") + "','" + x_address.Replace("'", "''") + "','" + x_city.Replace("'", "''") + "','" + x_state + "','" + x_zip + "','" + x_country + "','" + x_phone + "','" + x_fax + "','" + x_email + "','" + x_ship_to_first_name.Replace("'", "''") + "','" + x_ship_to_last_name.Replace("'", "''") + "','" + x_ship_to_address.Replace("'", "''") + "','" + x_ship_to_city.Replace("'", "''") + "','" + x_ship_to_state + "','" + x_ship_to_zip + "','" + x_ship_to_country + "'," + cashpay + "," + nocharge + "," + billcustomer + ",'" + ddlTimein.SelectedValue + "','" + ddlTimeout.SelectedValue + "')";
 
}
}
else
{if (CheckBox2.Checked)
{cashpay = "1";
}
else
{cashpay = "0";
}
 if (CheckBox3.Checked)
{nocharge = "1";
}
else
{nocharge = "0";
}
 if (CheckBox4.Checked)
{billcustomer = "1";
}
else
{billcustomer = "0";
}strInsert = "Insert into transactions(franchiseid,transdate,transowner,transamount,transPaymentMethod,transCardNumber,transExpirationDate,transRoutingNumber,transAccountNumber,transBankName,transNameOnBankAccount,transBankAccountType,transDispatchNumber,transDescription,transBillingFirstName,transBillingLastName,";
strInsert = strInsert + "transBillingCompany,transBillingAddress,transBillingCity,transBillingState,transBillingZip,transBillingCountry,transBillingPhone,transBillingFax,transBillingEmail,transShippingFirstName,transShippingLastName,transShippingAddress,transShippingCity,transShippingState,transShippingZip,transShippingCountry,transCashpayment,transNocharge,transBillcustomer,transtimeinn,transtimeout)";strInsert = strInsert + "values (" + Session["franchiseid"] + ",'" + DateTime.Now.ToString() + "','" + Session["username"].ToString().Replace("'", "''") + "','" + amtVal.Text + "','','','','','','','','','" + x_invoice_num + "','" + x_description.Replace("'", "''") + "','" + x_first_name.Replace("'", "''") + "','" + x_last_name.Replace("'", "''") + "','" + x_company.Replace("'", "''") + "','" + x_address.Replace("'", "''") + "','" + x_city.Replace("'", "''") + "','" + x_state + "','" + x_zip + "','" + x_country + "','" + x_phone + "','" + x_fax + "','" + x_email + "','" + x_ship_to_first_name.Replace("'", "''") + "','" + x_ship_to_last_name.Replace("'", "''") + "','" + x_ship_to_address.Replace("'", "''") + "','" + x_ship_to_city.Replace("'", "''") + "','" + x_ship_to_state + "','" + x_ship_to_zip + "','" + x_ship_to_country + "'," + cashpay + "," + nocharge + "," + billcustomer + ",'" + ddlTimein.SelectedValue + "','" + ddlTimeout.SelectedValue + "')";
//Response.Write("<br>autho" + strInsert);
}SqlCommand cmd1 = new SqlCommand(strInsert, objConn);
objConn.Open();
cmd1.ExecuteNonQuery();
objConn.Close();Response.Redirect("Printpaymentdetails.aspx");
 
}protected void Button1_Click(object sender, EventArgs e)
{Response.Redirect("ABCD.aspx");
}protected void CheckBox2_CheckedChanged(object sender, EventArgs e)
{if (CheckBox2.Checked)
{pnlPaaymentMethod.Visible = false;
pnlTransact.Visible = false;pnlPaymentCCA.Visible = false;
pnlPaymentInfo.Visible = false;amount.Visible = true;
}
else
{pnlPaaymentMethod.Visible = true;
pnlTransact.Visible = true;pnlPaymentInfo.Visible = true;
pnlCardifo.Visible = true;amount.Visible = false;
}
}
}
 
Here is the error iam getting
server Error in '/' Application. ----------------ExecuteNonQuery: CommandText property has not been initialized Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: ExecuteNonQuery: CommandText property has not been initializedSource Error:  Line 431:            SqlCommand cmd1 = new SqlCommand(strInsert,objConn);Line 432:            objConn.Open();Line 433:            cmd1.ExecuteNonQuery();Line 434:            objConn.Close();Line 435: Source File: d:Websitesserviceinfo.comsecurePaymentprocessing.aspx.cs    Line: 433 Stack Trace:  [InvalidOperationException: ExecuteNonQuery: CommandText property hasnot been initialized]   System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async) +873524   System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +72   System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135   Paymentprocessing.btnSubmit_Click(Object sender, EventArgs e) in d:Websitesxyassss.aspx.cs:433   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102   ----------------Version Information:  Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

View 2 Replies View Related

What Do I Have To Convert DateTime To , To Insert It In A CommandText

Mar 26, 2008

I keep trying to insert a Value in a field called Category and DateTIme in a field called date but I keep getting this error
The datetime field in the database is a data type DateTime. I converted the varible  into a ToString, I put it in a Convert.In32() method, I even set the varible to a DateTime datatype. doesnt work. whats wrong ?
Server Error in '/WebSite1' Application.


Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS1502: The best overloaded method match for 'System.Data.SqlClient.SqlParameterCollection.AddWithValue(string, object)' has some invalid argumentsSource Error:





Line 33: cmd.Parameters.AddWithValue("@Category", NewCat.Text);
Line 34: DateTime Date = DateTime.Now;
Line 35: cmd.Parameters.AddWithValue("@Date",Date.ToString);
Line 36:
Line 37: trySource File: c:Documents and SettingsCompaq_OwnerMy DocumentsVisual Studio 2008WebSitesWebSite1AdminCat.aspx.cs    Line: 35
Show Detailed Compiler Output:

View 5 Replies View Related

Are Multiple Statements Allowed For CommandText?

Dec 4, 2007

Hi,

I'm wondering if SqlCommand.CommandText could be set with multiple statements when CommandType=Text. anyone knows it?

I'm sure storedprocedure is the right way to go. I'm curious if this is one thing that only sp can do.

Thx
Tao

View 1 Replies View Related

CommandText Issue - SQL Reporting Services

Jul 23, 2005

I'm having a ton of trouble with a dataset. It builds at design time,but fails at runtime, saying:---------------------------Processing Errors---------------------------An error has occurred during report processing.Cannot set the command text for data set 'ds_Legal_Entity'.Error during processing of the CommandText expression of dataset'ds_Legal_Entity'.---------------------------OK---------------------------Below is the CommandText for ds_Legal_Entity that gives me the error:="SELECT DISTINCT dbo.t_d_legal_entity.legal_entity_desc FROMdbo.t_d_legal_entity INNER JOIN dbo.t_f_month_summary ONdbo.t_d_legal_entity.legal_entity_key =dbo.t_f_month_summary.legal_entity_key WHERE(dbo.t_f_month_summary.acctg_mth_key = " &Parameters!acctg_mth_key.Value & ")" &IIF(Parameters!BusUnitKey.Value = 0,""," AND(dbo.t_f_month_summary.bus_unit_key = " & Parameters!BusUnitKey.Value &")") & " ORDER BY dbo.t_d_business_unit.legal_entity_desc"If I delete everything after " & Parameters!acctg_mth_key.Value & ")",I won't get the error, so I assume that's where the problem lies. Ijust need another pair of eyes to see it.Thanks!Mike

View 1 Replies View Related

ExecuteReader: CommandText Propert Has Not Been Initialized

Oct 2, 2007



Hello All,

I receive the following error when attempting to preview or run a simple report:

ExecuteReader: CommandText propert has not been initialized


I have searched the help website and other forums, but I have had no success.

I am new to Reporting Services and this is one of the first reports I have created. All of my reports have this error.

Any ideas?

Thanks in advance.

View 1 Replies View Related

Problem With The SQL Insert With .CommandText() And .ExecuteNonQuery()

Jan 18, 2007

Hi

I have done a SQL statement INSERT for my coding. The program compiled and run the insertion with no error occurred. But after the compilation I found out that my database is not populated at all.

I tried the data insertion using the manual query, and I work perfectly.

So the problem now is that I do not know why my codes did not insert the data into my database. Will like to get some advise. Thanks

My codes are pasted in http://www.pastebin.ca/320102
The Debug.Writeline in the code is in http://www.pastebin.ca/320108


Thanks again.

View 4 Replies View Related

Error During Processing Of The CommandText Expression Of Dataset

Oct 17, 2007

An error has occurred during report processing.

Cannot set the command text for data set 'ScoreboardOLAP'.

Error during processing of the CommandText expression of dataset €˜ScoreboardOLAP€™

Can anyone help at all here? I've seen about 10 articles on this one but none appear to be relevant. I have a complex report comprising many sub-reports which runs successfully in a development environment. When deployed to an environment which comprises a separate report sever and report server DB I get the above error even when I try and browse to any of the sub-reports.

The sub-report is using an OLEDB connection to an SSAS DB and its command text is set as:-

=Code.GetQueryString(parameters)

Where GetQueryString is a function in the code section of the report which returns some MDX based on the supplied parameters. I obviously know the function works because it works in development mode.

I have tried to determine what is going on from the logs but the only messages I get are those above. I've set the data sources on the server up to use valid Windows Credentials stored on the server so I don't believe the issue is one of authentication

Any thoughts or tips in helping to diagnose the cause of the problem would be greatly appreciated.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved