
Puiu
Avatar/Signature-
Posts
90 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Puiu
-
1. What would be better to use: a form with a tab control that has around 20-25 tabs or a mdi form with 20-25 forms ? The user doesn�t see the tab pages, he moves between them using linkbuttons. 2. I have multiple textboxes where I want the user to insert only numbers. So far I thought about 2 ways to do this: I either let them write anything in the textbox and then check each character to see if it�s a number, or I can create a sub that handles the keypress for the textboxes
-
why do Update/insert Commands timeout sometimes?
Puiu replied to natarius's topic in Database / XML / Reporting
Maybe it could be that the other users update the same rows at the same time as you. Did you try to update or insert when you were sure that nobody was connected ? -
I have a stored proc something like this: Create proc AddAgent @param1 varchar(20), @param2 varchar(30) As Declare @Message varchar(200) �. Set @Message = �Some text� Return @Message When I call this proc from vb.net 2005 it returns an error saying: "Conversion failed when converting the varchar value 'Some text' to data type int." Any ideas? My guess is that it has something to do with the return statement In VB the syntax for the parameter is the following: Dim pMessage As New SqlParameter() pMessage.ParameterName = "@Message" pMessage.Direction = ParameterDirection.ReturnValue pMessage.SqlDbType = SqlDbType.VarChar pMessage.Size = 200 sqlComm.Parameters.Add(pMessage)
-
I had forgotten to put the provider string: Excel 8.0! Didn't realize that, sorry! Now it works perfectly Thank you
-
I'm trying to make a linked server from an Excel file, but i get an error when I try to select from it: OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "stanley" returned message "Unrecognized database format 'F:\Analiza.xls'.". I use SQLEXPRESS 2005. It worked fine when i tryed to link to an access mdb file... Any ideea why the database format is not recognized ?
-
I need to help a friend and make him a program in vb.net that will receive some ticket numbers from a website and check those numbers against a mysql database. The problem is that the site will most likely be built in php� How do I make the connection between that php site and my application ? Does anyone have any suggestions on where to start looking ? Thank you
-
I have a stored procedure that makes an insert into a database. Something like create proc InsAgent @Name varchar(100), @Age varchar(10), @Message varchar(100) output as insert into Agent values(@Name,@Age) set @Message='Success' My questions: 1. is it worth to use transactions with this kind of stored proc ? 2. If i want to exit a stored procedure i should type return In some cases i saw "return" followed by a number: return 11 or return 10... Is there any use for that number ?
-
Thank you again for your answer, Nerseus!
-
I have a database with 10 tables (give or take). The primary keys for these tables are IDENTITY columns. I can tell you already that there will be lots of joins. In this case I was thinking of creating a covering clustered index for each table for the primary key and some other column that would be often required in those joins. I was also thinking that I could add an extra nonclustered index on other less frequently used columns. I also know that the inserts will be made on at a time (btw what does �bulk insert� mean ?). In this case I suppose there won�t be a problem with the clustered index on the IDENTITY column. I was also wondering what is the query that will show me the existing indexes for a given table?
-
In the end i used Mysql Connector for .Net and it worked just like in VS 2003. Using the SQLDatasource (with an ODBC connection) i was able to connect to the mysql database, but i could not use the stored procedures like i was able with a MSSQL database. Thank you people
-
I have a stored procedure on MySQL Server that goes something like: Select * from phones where idphone=param1; in vb 2005 the code is: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click dim strLink as string ="3" sds.SelectCommand = "SrcModel" 'sds is a SQLDataSource sds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure Dim param1 As New FormParameter("param1", TypeCode.String, strLink) param1.Direction = Data.ParameterDirection.Input sds.SelectParameters.Add(param1) GridView1.DataSource = sds GridView1.DataBind() End Sub the connection string for the SQLDataSource is a dsn that works fine The problem is that the gridview doesn't show anything... there is no error either.. I don't get it, in vb 2003 you had something like: cmdSelect.ExecuteNonQuery What is the equivalent in VB 2005 ?
-
On my computer i have both mssql 2000 and mysql 5.0 installed and i'm trying to link to the mysql server through the mssql. I've used this: sp_addlinkedserver @server='MYSQL2', @srvproduct='Test', @provider='MSDASQL', @datasrc='', @location='', @provstr='Driver={MySql ODBC 3.51 driver};Server=localhost;port=3306;Option=131072; Database=MobilePhones;uid=root;pwd=mypwd', @catalog='' but when i try to access the linked server i get an error stating that it can't find the data source and that there is no default driver specified. what am i doing wrong here?? I've tried linking to an access database and it worked... And one more thing: Option=131072 what does it mean and where can i find the others Options and what they mean ? Thanks
-
I've got it!!! :) ----------------------------------- create proc SP_Search @WClause varchar(1000) as declare @SQL varchar(1000) set @SQL='select distinct m.idmedia, m.idcampaign, m.[description] from Media m, keywords k where m.idmedia=k.idmedia AND (' set @SQL =@SQL + @WClause + ')' --Select @SQL exec (@SQL) ------------------------- Sorry Nerseus, i didn't quite understand what you ment by you "really, REALLY should be using parameters for dynamic SQL in SQL Server.", i thought that @WClause was my parameter, but you probably ment what i did now...anyway thank you for the answer again! :) I'm happy now!
-
Thank you for the advice Kejpa! If i use SP_Search m.[description] like 'bird%' i get the following error: Line 1: Incorrect syntax near '.'. If i use SP_Search 'm.[description] like 'bird%' ' i get the error: Line 1: Incorrect syntax near 'bird'. I know i'm close :(
-
Thank you people, I�m almost done with this..but I have a small problem: I have a stored procedure named Search : Create Proc SP_Search @WClause varchar(1000) as exec ('select distinct m.idmedia, m.idcampaign, m.[description] from Media m, keywords k where m.idmedia=k.idmedia AND (''' + @WClause + ''') ') It�s the same like the first one, only instead of images I have Media� However, when I try to call SP_Search like this : SP_Search �m.[description] like bird%� I get an error. I can�t figure out how many quotes I must use. In an earlier post Nerseus explained me something similar, I know, but here is different because the parameter must be something like: m.[description] like bird% How should i pass corectly that parameter!? As for the Keywords table it didn�t cross my mind to use the idimage and the keyword as the primary key, it would have been a good idea. I put all the keywords on the same row because I thought I�d save some disk space.. what do you think ? Thank you!
-
I have a database with 2 tables: Images and Keywords. In the Keywords table i have the following data: IdKeyword_____IdImage_________Keyword ------------------------------------------------ 1____________10__________forest wood elf green 2____________11__________city steel car yellow subway 3____________12__________bird computer blue sky On my website the user enters in a textbox these words: forest city bird The select query would be something like this: Select i.* from Images i, keywords k where i.idimage=k.idimage and k.keyword like 'forest city bird' This query doesn't return anything. I know why, but I�d like to know how I can make this work. So far I�ve used full text search, but this works only when mssql server is installed. If you have msde you can�t use full-text search. If you have a solution that involves vb code or asp.net code, that�s fine too. Any suggestions?
-
Thank you Nerseus, you've opened my eyes a little more :) I'll probably come back soon with some new questions.
-
What i meant was that i was trying to learn dynamic SQL. I know that query was not perfect, but i was just wondering why i got that error!! What was wrong with that syntax ? Even if call it like this: exec test 'somedescription' I get the error: Invalid column name 'somedescription' Sorry for the delay
-
I've created a simple Stored Procedure: Create proc Test @Description varchar(100) as exec ('Select * from media where description in (' + @Description + ')') When i try to execute the procedure like this: Test ('forest') or exec Test ('forest') i get the following error message: Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'forest'. I'm guessing there is something wrong with the procedures' code, but i couldn't find out what.... Thanx
-
I've installed VS .Net, the Framework 1.1, IIS 6 and now when i type localhost in my browser it asks me for a password and a user name... I log on to windows using the Administrator account with no password! The thing is that i can't use any user/pass combination for the localhost Any ideeas?! Thanks
-
Thnk you for your answer joe mama! Actualy my query was a little more complicated than the one posted and it a simple matter of parantheses :) My bad i didn't ask corectly, but anyway your answer helped me afterwards ;) I would still have another question: Is there a way to compare the eficiency of a query (relative to another) in Sql 2000 ? I saw there is an Estimated Execution Plan and a Show Execution Plan... I was wondering if the Estimated Execution Plan compares the eficiency of 2 or more queries...
-
The table 0 is the table obtained with the sql command in my example. I would recomend you use a new dataset..honestly i think it would be easier I stated in my post that u should use dataset.clear before you fill the dataset with the data for the report, but this will clear the data that was stored in the dataset. If you really want to use the same dataset and not clear the data already in it(not using dataset.clear), i think u could use something like: DataAdapter.fill(Dataset,"MyTable") .... ReportDocument.SetDataSource(Dataset.Tables("MyTable")) I haven't tried this before, so I don't know what results it would return...I guess they should be the same
-
If you plan on using the same dataset for more than one operation than you should call Dataset.clear() before using it... Now back to crystal reports: Dim DaReport as new sqlDataAdapter(sqlCommand,SqlConnection) DaReport.Fill(Dataset) ReportDocument.SetDataSource(Dataset.Tables(0)) ' Make sure you don't forget that Tables(0) CrystalViewer1.ReportSource=ReportDocument When you create the report document and choose your database do not select a table, select "command" and you should enter a query that would return the same columns as the SqlCommand used for the DataAdapter Cheers
-
the @Value is varchar(100) But i haven't implemented the proc in VB yet...it's in the query analizer that i get no results!
-
1.Could anyone tell me if I were to use the OPTION FAST(x) in an SQL query (where x is a number smaller then the total number of rows returned by the query) would it be of any help if i use that query in ASP.NET to fill a dataset ? For as much as i know a dataset is completly filled with the data and then it is displayed 2. I have a query that sounds like this: select * from Media where Description like @Value and convert(char(10),ShootingDate,110) =@BeginDate The problem is that if leave the @Value blank ('') and @beginDate is a date found in the table there are no results returned. If I use "or" instead of "and" and I give @Value a value and @Begindate a date it returns all the rows that match the date without looking at the @Value ! The question is: Can I create a query that checks for both @Value and @BeginDate and if one is missing to check only for the one given ? And how ? 10x