Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness … at System.Convert.ToInt32(String value)\r\n at SearchingforJob.DAL.Connection_Handler.Execute_SQL() in C:\\Documents\\Visual Studio 2010\\Projects\\SearchingforJob…\\SearchingforJob\\DAL\\Connection_Handler.cs:line 46\r\n at SearchingforJob.input.button1_Click… How to add a computed field to a DAL table Programming Databases by blackbr -I am using vs2008's table adapters for a DAL for several tables. -I have a computed field (FirstLastName) in … Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness I have a connection in a DAL to SQL server. Using this connection I am trying to … Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro Hi there! You can't convert an SQLDataReader to an int. You have to use the reader to get your values. Check those links: http://msdn.microsoft.com/pt-br/library/haa3afyz(v=vs.110).aspx http://www.akadia.com/services/dotnet_data_reader.html Anyway... I think is more practial to use an DataSet, something like this: class Connection_Handler… Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness it returns "cannot find table 0" The database isnt empty. Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro Is ds.Tables null? Is the connection and query ok? Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness Hi it accesses the database. the resulting error message is "input string was not a correct format" Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro In wich line does this error occurrs? Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness On debugging, ds.Tables[0].Rows[0][0] shows the value from the query in execute_SQL(). from if (ds.Tables[0].Rows.Count > 0) { return Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString()); } return -1; the error is thrown after the… Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro Whats the value in `ds.Tables[0].Rows[0][0]` ? In debugging, use the Exception.StackTrace and Exception.InnerException.StackTrace to see exactly where the errors occurs and it's full stack trace. Obs.: InnerException is recursive. Re: Cannot select SQL query with DAL to show in message box Programming Web Development by BMXDad Looks like your trying to convert "monster.co.uk" to an int Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro ggamble is right... I assume that you were selecting an int, because you was already converting. If the value is 'monster.co.uk' you can't convert it, just use .ToString(). Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness Hi, I have an if statement in my connectionhandler and it will not let me return a string for ds.Tables[0].Rows[0][0] i tried making a variable and it still didnt like it. here is the code im on at the moment. if (ds.Tables[0].Rows.Count > 0) { string reader = ds.Tables[0].Rows[0][0].… Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro That's probably because your method returns an int. Try this: public string Execute_SQL(string select) { ConnectiontoSQL(); string Query = "select " + select + " from jobSearch where searchID = 1"; DataSet ds = SelectSQL(Query); if ( ds.Tables[0].… Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness will not debug. cannot implicitly convert type "string" to "int" Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness Sorted it. changed `public int Execute_SQL()`, to `public string Execute_SQL()` Re: Cannot select SQL query with DAL to show in message box Programming Web Development by AleMonteiro That's exactly what I posted. =) Re: Cannot select SQL query with DAL to show in message box Programming Web Development by adrian.mcguinness My apologies. Master Child Display using Nested repeater C#/Oracle Programming Web Development by sydneyram …strInventoryItemId, ID); string countRdr = OrderEntry.Components.DAL.Database.GetOracleScalar(strInventoryItemId); countOfItems = Convert.ToInt16(….Format(strInventoryItemId, ID); return OrderEntry.Components.DAL.Database.GetOracleDataReader(strInventoryItemId); } public OracleDataReader ProductName… Return a list of items within a category Programming Software Development by Shari_1 … string catName {get; set;} } // From my database model (DBModel) in DAL project public class DbItem { public int itemID {get; set;} public…(items); } // My VIEW page // top of the page @model Project.DAL.DbCategory // using for loop to list the items. I know… Need help on Integration Testing using STUBS and/or MOCKERYS! Programming Software Development by dr_iton …{ KlasaDB.Shto(obj); } } } DAL using System; using System.Collections.Generic; using…public void Test_ShtoKlasa() { Assert.AreEqual(true, DAL.KlasaDB.Shto(klasa)); } } } This works… How to build the correct way of n-tier apps without service and remoting? Programming Software Development by witecloner …Implements BLL.Interfaces.ISatuan.Loading_Data Dim ta As New DAL.DataSet_SatuanTableAdapters.UnitTableAdapter Dim Satuan As New BLL.DataSet_Satuan …System.EventArgs) Handles MyBase.Load Dim DataSatuan As New DAL.SatuanManager Me.DataGridView1.DataSource = DataSatuan.Loading_Data.Unit With… WCF function that returns a List Programming Web Development by vuyiswamb …System.Web; using System.Configuration; using System.ComponentModel; namespace DAL { public class DAL:IDAL { String strCon = ConfigurationManager.ConnectionStrings["DBConnectionString"].…,43) : error CS0426: The type name 'DAL' does not exist in the type 'DAL.DAL'[/CODE] but when i remove this line… Struggling to save DataSet to Database Programming Software Development by TarkiB …class AddLawyerHandler { DAL.LawyerDataSet dsLaw = new DAL.LawyerDataSet(); DAL.LawyerDataSetTableAdapters.LawyerTableAdapter lawyerList = new DAL.LawyerDataSetTableAdapters.LawyerTableAdapter(); DAL.LawyerDataSet.LawyerDataTable LawyerTable = new DAL.LawyerDataSet.LawyerDataTable(); static… Re: hi all Programming Software Development by rahulvom … int InsertData(int tab_id, string tab_name) { DAL dal = new DAL(); try { return dal.InsertData(tab_id, tab_name); } catch { throw; } finally { dal = null; } } } User Interface: namespace WindowsApplication4… failed to SaveChanges() the Framework Entity Programming Web Development by Rinacom I Build an ASP.NET project with PL,BL,DAl, BE of Entity Data Model(=.edmx) which …Based DB (= .mdf) which is located in my DAL project. I did copied the connectionString from the BE app… share. my code logic is PL->BL->DAL- > try to save the new object to… }[/CODE] Feedback is a table in my DAL's SQL which I generate as Object entity. Trying to use class files, getting "undefined reference to `WinMain@16'" Programming Software Development by TheNotoriousWMB … int main() { Trip StL, Indy, Det, Nash, Dal, Den, NY, LA, Mia, Sea; int choice; …Nash.TripTime(&Nash); break; case 5: Dal.TripTime(&Dal); break; case 6: Den.TripTime(&Den… Re: Return an anonymous type in my Method Programming Software Development by k1robert …String) As IEnumerable(Of DCProposal) Dim dal As New ProposalDAL() Return dal.BasicSearchProposals(searchVal) End Function [/CODE] lastly… searchVal As String) As IQueryable Dim dal As New ProposalDAL() Return dal.BasicSearchProposals(searchVal) End Function [/CODE] … Re: WCF function that returns a List Programming Web Development by tinymark This is a guess. Where did you import your namespace DAL from? Re: Inserting data into a server database Programming Software Development by Nishara … e) { try { fullsql = "Select * from Users"; dal = new DataAccessLayer(); UserTable = dal.getTable(fullsql); DataRow dtr = UserTable.NewRow(); dtr["UserID…