Tejas34's Q&A profile
Visual Studio Express Editions Question about database and C# commands
I’m making a program that uses a SQL Express database and i have a table called Utilizador (user) and it’s primary key ID_Utilizador wich is an automatic int counter (1-2-3....etc), and i cant alter its value. What i need is to find a way in C# 2005 Express to know the next ID number that the next row to be inserted will have without knowing the ID number of the last row to be inserted. Maybe there is a command for this but i cant find it. Regards Rui Hi, i didn’t explain but that is not why i want to know the ID number, i cant even insert the ID number because it’s the Identity key of the table, and so in C# 2005 Express the field is not part of the insert method. I needed to know the ID n ...Show All
Visual C++ Repost-Same code compiled sucessfully on a desktop but failed on a laptop
Repost due to the display error.--- Below code can buit sucessfully on a DELL desktop but failed on a compaq laptop.The compiler said that snack 's size is unknow. #include<iostream> #include<string> using std::cout; using std::cin; using std::endl; using std::string; struct CindyBar{ string brand; float weight; int calory; }; int main(){ cout<<"Plesae enter the size to determine the array:\n"; int size; (cin>>size).get(); CindyBar *snack=new CindyBar[size]; cout<<"Please enter the items one by one:\n"; for(int i=0;i<size;i++){ cout<<"Please enter the No."<<i+1<<" 's brand:\n"; getline(cin,snack[ i ].brand); ...Show All
Visual C# call JavaScript from C# ActiveX
Hello, I've created a C# activex control.... [GUID("...")] [ProgId("Test.AX")] public class Test { string Test() { return "from com component"; } } now when I instantiate this component in js comp = new activeXObject("Test.AX"); I can call alert(comp.Test()); and a messagebox with the text from the c# dll pops up. How can I call functions in the other way -> call a function in the javascript file from the dll thanks and greets from germany Scipts tends to be changed more often than ActiveX. Better if you change your design. Declare some events and handle them in scripts, and in turn the event handlers call script functions. If you really want to call ...Show All
SQL Server Creating RDL using information contained in an existing Data Model
This question is in regard to creating RDL programmatically, using information contained in an existing Data Model; basically mimicking what the Report Builder does. What I need to do is integrate a dummied down version of the Report Builder into an existing web application; where users will have the option to build and save reports using a very simple web interface, 4 step process. This process will only have a very few of the options that the Report Builder has. So far I have built this process referencing the Microsoft Reporting Services dll's (Microsoft.ReportingServices.Modeling.dll for example), in order to retrieve the entity and attributes information from the Data Model. ** Does anyone know how I could create the RDL, usi ...Show All
SQL Server Creating a Proxy Account
I am trying to run SSIS packages under SQL Server Agent 2005 and I keep getting a package failed error in the event viewer. I've heard that I need to set up a proxy account. I have found the following code and need a little explanation on what all the parts mean since I am very new to this: Use master CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword' Use msdb Sp_add_proxy @proxy_name='MyProxy', @credential_name='MyCredential' Sp_grant_login_to_proxy @login_name=' devlogin', @proxy_name='MyProxy' Sp_grant_proxy_to_subsystem @proxy_name='MyProxy', @subsystem_name='SSIS' Let's say for the sake of argument my domain is called CompanyInc and I log into wind ...Show All
Visual Studio Team System CTP7 BUG - Block Schema Updates if Data Loss Might Occur - Does not block data loss
CTP7 - Tools->Options->Database Tools->Schema Compare ->Block schema updates if data loss might occur IS CHECKED. - Project Properties->Build -> Block Incremental Deployment if data loss might occur IS CHECKED I would expect, as the options are self explanitory, that a deploy / or schema compare would be blocked when I refactor a COLUMN name. At least the refactor wizard warns you that there will be data loss if there is data in the table. If I don't use the refactor wizard I will not get this warning, and apparently the option does not prevent the update / data loss. Tests here have definately resulted in data loss using schema compare and deploy. Scenario - renamed a COLUMN from "Text7" to "Text4 ...Show All
SQL Server Change script from MSAccess to SQL access.
I'm using this script I found on the web. After some tweaking here and there, it works great. I'd like to change it to pull data from a SQL source instead of Access. Anyone know how to do this, give me some pointers Here is the script ***************************************************************************************************************** <%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% Dim DATA_PATH, Conn, DataRecords, email, user, pass, sendmail 'Maps to database. Change to your database path. DATA_PATH=Server.Mappath("membersdb.mdb") ' Create and intiate data connection Set Conn = Server.CreateObject("ADODB.Connection") Conn.ConnectionTimeout = 15 Conn.CommandTimeout = 30 Conn.Ope ...Show All
.NET Development table adapters - update
Can anyone explain why this code will not work- it will not add a new record everything else works fine. switch ( this .my_action) { case "Edit" : this .bsNCRdetail.EndEdit(); this .nCRdetailTableAdapter.Update( this ._2000NCRDataSet1.NCRdetail ); MessageBox .Show( "Record has been updated" ); this .nCRdetailTableAdapter.Fill( this ._2000NCRDataSet1.NCRdetail); break ; case "Add" : this .nCRdetailTableAdapter.Update( this ._2000NCRDataSet1.NCRdetail); MessageBox .Show( "Record has been added" ); this .nCRdetailTableAdapter.Fill( this ._2000NCRDataSet1.NCRdetail); break ; case "Delete" : this .nCRdetailTableAda ...Show All
Smart Device Development DataGrid add and delete rows problem
Hi. I developped a mobile inventory system under Vistual Studio 2005 C#.net, i bound datagrid with inventory table. i can add rows at some search condition to the DataGrid, i can delete selected row in the DataGrid, but after update the dataAdaptor, the deleted row still there. The following is my code. Add rows to the DataGrid barCodeString = textBoxBarCode.Text + "%"; this.inventoryTableAdapter.FillByBarCodeName (this.orderDB_enDataSet.Inventory, barCodeString); Delete rows from the DataGrid int i = inventoryDataGrid.CurrentCell.RowNumber; orderDB_enDataSet.Inventory.Rows.RemoveAt(i); this.inventoryBindingSource.EndEdit(); this.inventoryTableAdapter.Update(this.orderDB_enDa ...Show All
.NET Development Hosting Remoting objects in IIS
Hello everybody, is it a better option to host remoting server objects in a window service or IIS i would like to know your opinions. thanx bhavtosh Hi, Hosting it on IIS gives you all the access framework, security, pools, availability. You can have also these features hosting the service using a winservice or a console app but you will have to write your own handlers. Also, IIS will serialize using HTML only (I think this has changed on .NET 2), where HTML is plain text generating bigger packages. Therefore, slower but more adaptable with less code. If you host your own service you can use Binary Serialization that is smaller, therefore faster connection but the other end should know how to diserialize it. Reg ...Show All
.NET Development Manipulating String
This is probably a really basic problem but what is the most elegant way of doing this. I need to grab the current date and time so I use DateTime.Now from the DateTime class. The ToString() call returns: 30/06/2006 13:45 I need it converted to 30062006-1345 I've tried using a combination of String.Contains() & String.Remove() with no avail since Remove removes everything after the index. Is using a tokenizer the only way to go That custom string format is very nifty! With the previous method it still worked but I had to manually pad it out to 2 digits for the month value. Very good replies, thanks! ...Show All
.NET Development Error when importing an Excel SS into a dataset
Hi; What can I not fill my dataset once I have connect to my Excel ss. When I get to the fill ds part of my code I get the following exception " "The Microsoft Jet database Engine could not find the object "tab1". Make sure the object exists and that you spell the name and path correctly." Here is the code I am trying to use: Option Explicit On Imports System Imports System.IO Imports System.data Imports System.Data.OleDb Module ptr423Late Dim sPath As String = "C:\Desktop\657423.mdb" Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sPath & ";Persist Security Info=False" Dim Conn As OleDbConnection = New OleDbConnection(con ...Show All
SQL Server Is it the right response from AS 2005???
I have configured HTTP Access to SQL Server 2005 Analysis Services on Microsoft Windows Server 2003. When I run the URl http://localhost/olap/msmdpump.dll in the browser, the generated response is below. <soap:Envelope> <soap:Body> <soap:Fault> <faultcode>XMLAnalysisError.0xc10e0002</faultcode> <faultstring>Parser: The syntax for 'GET' is incorrect.</faultstring> <detail> <Error ErrorCode="3238920194" Description="Parser: The syntax for 'GET' is incorrect." Source="Unknown" HelpFile=""/> </detail> </soap:Fault> </soap:Body> </soap:Envelope> Is it the ri ...Show All
Visual Basic if somthing exists
How would I check if something exists on a web page that is displayed in my app. Private Function DocContains ( ByVal Criteria As String ) As Boolean Dim wb As New WebBrowser wb . Navigate ( "http://www.google.com" ) Dim HTMLContent As String = wb . DocumentText If HTMLContent . Contains ( Criteria ) Then Return True Else Return False End If End Function ...Show All
SQL Server Exporting a table with changing column names to an excel file
I'm trying to write an SSIS package that exports a table that has changing column names to an excel file. The column names change due to the fact that the table is created by a pivot daily. the only thing I'm missing is the ability to dynamically map the tables' columns to the excel destination. Is this possible I read in another thread that "It is not possible to create packages or new objects within packages using SSIS." I also read in the books online that "The input and the input columns of the Excel destination have no custom properties." To me this means that I cannot programmatically create or remove columns in the excel destination. Please tell me I'm wrong. So, to summarize my research so far. In writing an ...Show All
