Returning year as a value of the combo box


rated by 0 users Hi , I have cboYear and its should be dynamically fillout with the current year, the previous and following year.... example 2012, 2011, 2010, 2009... and current year will be the default value... If anyone could help me please..
Posted On: Thursday 13th of September 2012 06:34:08 AM Total Views:  38
View Complete with Replies

RELATED TOPICS OF Visual Basic PROGRAMMING LANGUAGE




Web service returning an error??? Need Help

Hi , I have two applications - 1) desktop and 2) Web. The users enter data through the web and I download that data through the desktop app for further processing. I have a web service in web app. The desktop app connects to the web service to download the data. I changed the web app and did deployment and received error in my desktop app while downloading the data. Following is the log entry: TimeStamp : 2/8/2012 7:26:48 PM FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a AppDomainName : desktopapp.exe ThreadIdentity : WindowsIdentity :            Inner Exception           ---------------           Type : System.Net.WebException, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089           Message : The remote server returned an error: (404) Not Found.           Source : System           Help link :           Status : ProtocolError           Response : System.Net.HttpWebResponse           Data : System.Collections.ListDictionaryInternal           TargetSite : System.Net.WebResponse GetResponse()           Stack Trace :    at System.Net.HttpWebRequest.GetResponse()              at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)  Category: Exception Priority: 100 EventId: 100 Severity: Error Title: desktopapp Application Domain: desktopapp.exe Process Id: 7044 Process Name: C:\xyz\desktopapp.exe Win32 Thread Id: 7068 Thread Name: Extended Properties: Need help urgently.
VIEWS ON THIS POST

65

Posted on:

Wednesday 19th September 2012
View Replies!

Setting dropdownlist when returning to webpage

I have a dropdownlist that is being filled by an sqldatasource. What I need to do is set the dropdown choice of the user when returning to the page. So the ropdown will show the selection of the dropdown instead of the defaulted view when it first loads. I have tried the code below but I am getting an instance is not set to an object when returning to the page. I have this code in the page_load and in an if not postback. If Trim(Session("cldlisttext")) = String.Empty Then Else setValDatedd = Session("cldlisttext") End If Try With ddlClosed .Items.FindByText(setValDatedd).Selected = True Enabled = True End With dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('d6844978a2154c9494b91e5753a58e8d') dp.SyntaxHighlighter.Highlight('fecce07eb5bb4ffab2d27e5947428b89')
VIEWS ON THIS POST

29

Posted on:

Wednesday 26th September 2012
View Replies!

returning a value from application.run

I'm pretty sure this is an easy one but I can't find the answer anywhere. I am calling a function in VBA and I want it to return a value to me My code is as follows SQLConn = Application.Run(ConnectionFile, "site") Connectionfile is a function in another excel file and builds a connection string like the one below getConn = "ODBC;DRIVER=SQL Server;UID=" & username & ";PWD=" & password & ";APP=Microsoft Query;SERVER=" & server & ";DATABASE=" & sn I know the function I am calling works but I want to populate the SQLConn string with the connection string that was built by connectionfile. The code I have above results in sqlconn remaining empty "" Please help dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf' dp.SyntaxHighlighter.Highlight('146683048eba434ab50d06500d62e10c') dp.SyntaxHighlighter.Highlight('dc7a1d5657e44718bbb8612b5c7c88fa')
VIEWS ON THIS POST

38

Posted on:

Monday 1st October 2012
View Replies!

Excel - returning a cell address

I am using some Hlookups to find some text in a datasheet, and i would also like to get the cell position (preferably in the form "A1", but if its in R1C1 i can convert that myself) of the cell which the Hlookup finds so i can then copy that specific cell (rather than referencing it via a HLookup) using VB code. If anyone can help with the code to get this to work i would be most grateful as i have been trying to work this out for days now!
VIEWS ON THIS POST

169

Posted on:

Friday 12th October 2012
View Replies!

Form calling another then returning

I would like to create an application where I have a main form give the user a choice to load one of three others and then when on one of these, load some data saved into an array, then they can return to the main form. i.e. Form A will call either Form B, Form C, or Form D. Once the data is loaded, return to Form A.
VIEWS ON THIS POST

117

Posted on:

Saturday 13th October 2012
View Replies!

ADO not returning records containing null values

"It's not that I'm surrounded by incompetence that bothers me, it's that I fit in so well." | Post Points: 20 Geof Cincinnati, OH, USA Since 4/18/2005 Posts 12,816 Reputation 90,024 Reply Geof Wyght (Geof) replied on 10/12/2007 3:40 PM rated by 0 users To start with, and to be sure, post the content of spSHSHLGetScoringByPeriod.
VIEWS ON THIS POST

112

Posted on:

Saturday 13th October 2012
View Replies!

Re: [Help]instr returning Wrong value?

Im having a problem with instr Its simply put, returning an unexpected value. I search for the position of 2 characters "(" and ")". String Im using instr on Code: INSERT INTO Drop_Data (dropperid, itemid, minimum_quantity, maximum_quantity, questid, chance) VALUES now the "(" returns the correct position of 23. However when instr looks for ")" it finds it incorrectly at position 94 Code: If fline = 1 Then TextOutPut(0) = ttext & vbCrLf a = InStr(1, TextOutPut(0), "(") b = InStr(1, TextOutPut(0), ")") Debug.Print ttext ttext = Mid(TextOutPut(0), a, b) Debug.Print ttext End If thats the code im using right now I need ttext to be equal to the data inside the "(" and ")". Anyone got any ideas why instr isnt working
VIEWS ON THIS POST

158

Posted on:

Tuesday 16th October 2012
View Replies!

Re: Current provider does not support returning multiple recordsets from a single exe

Hi I am trying to convert a VBA code into VB one but i stuck with the recordset problem because in VBA the connection is open so it can access diff' recordsets one by one but in case of VB it throws me error:"Current provider does not support returning multiple recordsets from a single execution". VBA code: Do Until RS Is Nothing Set rng = WS.Cells(lRow + 1, lCol) If RS.RecordCount > 0 Then rng.CopyFromRecordset RS '\\ copy data FormatFields WS, RS, lRow '\\ set headings If RS.Fields(0).Name = "Heading" Then Set rng = WS.Range(WS.Cells(lRow + 1, 1), WS.Cells(lRow + RS.RecordCount, RS.Fields.Count)) rngColl.Add rng End If lRow = lRow + RS.RecordCount + IIf(iRS Mod 2, 2, 3) '\\ skip rows End If 'Set RS = RS.NextRecordset iRS = iRS + 1 Loop VB code: With RS Do While Not .EOF Set rng = WS.Cells(lRow + 1, lCol) If RS.RecordCount > 0 Then rng.CopyFromRecordset RS '\\ copy data--also paste it on sheet FormatFields WS, RS, lRow '\\ set headings If RS.Fields(0).Name = "Heading" Then Set rng = WS.Range(WS.Cells(lRow + 1, 1), WS.Cells(lRow + RS.RecordCount, RS.Fields.Count)) rngColl.Add rng End If lRow = lRow + RS.RecordCount + IIf(iRS Mod 2, 2, 3) '\\ skip rows End If If RS.RecordCount > 0 Then Set RS = RS.NextRecordset iRS = iRS + 1 End If Loop End With Please guide me further i need to get this done urgent...
VIEWS ON THIS POST

234

Posted on:

Wednesday 17th October 2012
View Replies!

Vb and c dll error in returning values

this is my first post in this forum so please excuse me if this is in the wrong section. im using visual studio c++ and VB 6.0 and have created a dll which builds correctly. i am passing 3 arguments from my VB code and expecting a VB long (or C integer) as return value. After passing the parameters VB crashes. i think it does so when the value is being returned or the varaible passed as reference is being accessed. please correct any bugs and suggest a good technique to communicate between the dll and visual basic code, here are relevant portions of the VB code: Code: Private Declare Function get_status _ Lib "C:\Users\NandoNachi\Desktop\get_status\Debug\get_status.dll" _ (ByVal szReturnIP As String, _ ByVal iSize As String, ByRef retval As String) Private Sub Command1_Click() Dim lval As Long Dim retval As String Dim finalval As String retval = String$(15, vbNullChar) f = validate 'validate is a function which takes no argument and returns a boolean 'SUB ROUTINES DO NOT RETURN A VALUE, A FUNCTION HAS TO If f = True Then lval=get_status (Text1.Text, Text2.Text, retval) finalval = ctovbstring(retval) End If 'Label1.Caption = lval End Sub Public Function ctovbstring(ByVal cstring As String) As String Dim returnstr As String Dim temp As Integer temp = InStr(cstring, vbNullChar) If temp > 0 Then returnstr = Left(cstring, temp - 1) Else returnstr = cstring End If ctovbstring = returnstr End Function and the C code with relevant portions: Code: int __stdcall get_status(char *pnr1,char *pnr2,char *to_return){ WSADATA wsaData; int iResult; int temp; //IN WINDOWS, SOCKET IS OF TYPE SOCKET SOCKET handle; // will point to the socket char final_msg[1000]; char *recv_buffer=(char *)malloc(1000*sizeof(char)); char *to_parse= (char *)malloc(1000000*sizeof(char)); struct sockaddr_in server_info; // will contain the server's info, also used in connect call struct hostent *name_2_addr; //will be used in gethostbyname to find the corresponding ipaddress of the name of given destination hostent struct in_addr **addr_list; // Initialize Winsock iResult = WSAStartup(MAKEWORD(2,2), &wsaData); if (iResult != 0) { return 0; } to_parse[0]='\0'; memset(final_msg,'\0',sizeof(final_msg)); memset(recv_buffer,'\0',sizeof(recv_buffer)); //SOCKET CREATION handle= socket( AF_INET , SOCK_STREAM, 0); if( handle ==INVALID_SOCKET) err_handl("SOCKET ERROR",recv_buffer,to_parse,&handle); name_2_addr=gethostbyname(HOSTNAME); if(name_2_addr == NULL){ return 0; } memset(&server_info,0,sizeof(server_info)); server_info.sin_family=AF_INET; server_info.sin_port=htons(PORT); addr_list=(struct in_addr **)name_2_addr->h_addr_list; //in beej guide it is given that h_addr_list is actually struct in_addr! go check it //addr list now contains the all the addresses of a given hostname in NETWORK BYTE server_info.sin_addr=*addr_list[0]; //CONNECT CALL PERFORMED if ( (temp=connect(handle,( struct sockaddr *)&server_info,sizeof(server_info))) == SOCKET_ERROR ) err_handl("CONNECT ERROR",recv_buffer,to_parse,&handle); memset(final_msg,'\0',sizeof(final_msg)); if( sendpostmsg(final_msg,pnr1,pnr2,&handle) ) //send it err_handl("SEND ERROR",recv_buffer,to_parse,&handle); //RECV THE OUTPUT recv_msg(recv_buffer,to_parse,&handle); parser(to_parse,to_return); free(recv_buffer); free(to_parse); closesocket(handle); WSACleanup(); return 1; } void parser(char *to_parse,char *to_return){ char* ret_val=strstr(to_parse,"ERROR"); //No occurence of Error if(ret_val == NULL){ strcpy(to_return, "01"); } else //more checks required, check the next string to make it more robust strcpy(to_return,"00"); }
VIEWS ON THIS POST

237

Posted on:

Wednesday 24th October 2012
View Replies!

HELP with returning DataRow Object from Webservice

Hi ALL, can soneone help me\t I want to return a DataRow Object from a Webservice but it ist not Serializable. What can I do .. Please help
VIEWS ON THIS POST

118

Posted on:

Friday 2nd November 2012
View Replies!

Function returning a boolean value and a string.

Hi how can I return a boolean valua "and" a string from a function. I know how to do boolean value or string from a function but how can I return both... Function (username as string, password as string) as boolean End function
VIEWS ON THIS POST

295

Posted on:

Friday 2nd November 2012
View Replies!

Gridview For loop returning the first row

How can i solve this pls help.ForEachgvRowAsGridViewRowIngvClients.Rows cmdExcel.CommandText="INSERTINTO[Sheet2$](tvlr_Lastname,tvlr_Firstname,tvlr_title)"&"values(@Surname,@FName,@Title)" cmdExcel.Parameters.AddWithValue("@Surname", gvRow.Cells(0).Text) cmdExcel.Parameters.AddWithValue("@FName", gvRow.Cells(1).Text) cmdExcel.Parameters.AddWithValue("@Title", gvRow.Cells(2).Text) cmdExcel.ExecuteNonQuery() Next
VIEWS ON THIS POST

260

Posted on:

Saturday 3rd November 2012
View Replies!

Syntax for method returning a string()

I have a method that returns a string array. Rather than create a local variable to temporarily hold a string array I want to use the method name as the array. I just can't come up with VB.NET syntax for instantiating the array as the method name. My function declaration is GetInventory() As String() rather than do this Dim arr(20) as string ...... code to fill arr ......... GetInventory = arr I want to do this GetInventory(20) as string xxx .... code to fill GetInventory .... I've spent half an hour trying to figure out how to code the xxxx line to no avail.
VIEWS ON THIS POST

296

Posted on:

Saturday 3rd November 2012
View Replies!

Problem returning from a function

Hi; I have a variable in my code that the compiler doesn't like and I can't seem to understand what's wrong with the variable. The compiler says my return variable "aTable is not declared" ! Here is the code:
VIEWS ON THIS POST

153

Posted on:

Wednesday 7th November 2012
View Replies!

returning 2-dimensional array

I want to define a 2-dimensional array of string and then assign the return value from a function to this... dim MyArray as \t\t 'here I want to define adynamic array of string with dimensions 5 by 3 MyArray=GetTwoDimensionalArray() function GetTwoDimensionalArray as \t\t 'here I want to define a function that returns a 2-dimensional array which I can assign to MyArray (values for this array are retreived from a database) return \t 'here I want to return the filled 2-dimensional array end function
VIEWS ON THIS POST

170

Posted on:

Wednesday 7th November 2012
View Replies!

Class Not returning accurate values

, Please can anyone look at this class and say why it's just returning just the first row in the second query, the issue is that the Salary is showing the right value when debugging, but when deployed to IIS it's just returning the 1st row Imports System Imports System.Collections Imports System.ComponentModel Imports System.Data Imports System.Linq Imports Telerik.Web.UI Imports EMPTaxesLINQ Namespace EmployeeTaxes.DataLoad \t Public Class GetData \t\t\t Public Shared Function GetSalary(ByVal sEmployeeID, ByVal Sdate, ByVal Edate) As Decimal \t\t\t\t\t Dim sMonth, eMonth, sYear, sEMPID, AbsenceTotal, SalaryType As Integer \t\t\t\t\t Dim DailyRate As Decimal \t\t\t\t\t Dim db As New EMPTaxesLINQ.EMPDCDataContext() \t\t\t\t\t Dim salary As Decimal = 0 \t\t\t\t\t sEMPID = Convert.ToInt32(sEmployeeID) \t\t\t\t\t 'get salary type \t\t\t\t\t Dim EMPdata = db.usp_rr_admin_pu_getEmployeeInfo(sEmployeeID).SingleOrDefault \t\t\t\t\t If EMPdata Is Nothing Then \t\t\t\t\t Else \t\t\t\t\t\t\t SalaryType = EMPdata.SalaryType \t\t\t\t\t End If \t\t\t\t\t sMonth = Sdate.Month \t\t\t\t\t sYear = Sdate.Year \t\t\t\t\t eMonth = Edate.Month \t\t\t\t\t Dim EMDATA = From p In ((db.usp_rr_admin_pu_getEmployeeMonthlyData(sEmployeeID, Sdate.Month, Edate.Month, Sdate.Year))) \t\t\t\t\t If EMDATA Is Nothing Then \t\t\t\t\t Else \t\t\t\t\t\t\t For Each p In EMDATA \t\t\t\t\t\t\t\t\t If SalaryType = 1 Then 'MONTHLY \t\t\t\t\t\t\t\t\t\t\t DailyRate = (p.BaseSalary / 26) \t\t\t\t\t\t\t\t\t\t\t AbsenceTotal = DailyRate * p.Absence \t\t\t\t\t\t\t\t\t\t\t salary = (p.BaseSalary - AbsenceTotal) + salary \t\t\t\t\t\t\t\t\t End If \t\t\t\t\t\t\t\t\t If SalaryType = 2 Then 'DAILY \t\t\t\t\t\t\t\t\t\t\t salary = (p.BaseSalary * p.Attendance) + salary \t\t\t\t\t\t\t\t\t End If \t\t\t\t\t\t\t\t\t If SalaryType = 3 Then 'Hourly \t\t\t\t\t\t\t\t\t\t\t salary = (p.BaseSalary * p.WorkingHours) + salary \t\t\t\t\t\t\t\t\t End If \t\t\t\t\t\t\t Next \t\t\t\t\t End If \t\t\t\t\t db.Dispose() \t\t\t\t\t db = Nothing \t\t\t\t\t Return salary.ToString("N2") \t\t\t End Function \t\t\t\t\t\t\t\t \t End Class End Namespace \t
VIEWS ON THIS POST

132

Posted on:

Wednesday 7th November 2012
View Replies!

SQL in VB 6.0 Not returning data from Paradox Table

Hi: I have a program in VB 6.0 that connects to an access database and connects to a paradox database (directory)... I query an Access table and it returns the data I need...as the program begins. The operator selects a ...
VIEWS ON THIS POST

418

Posted on:

Saturday 10th November 2012
View Replies!

VB6, SOAP and web services returning a binary object

Hi , I am seeking either code, or links to code that demonstrate calling a web service that returns a binary object that must be saved as a pdf. I have googled around, but am not sure how to declare ...
VIEWS ON THIS POST

268

Posted on:

Sunday 11th November 2012
View Replies!

SQL in VB 6.0 not returning data from Paradox Table

Hi: I have a program in VB 6.0 that connects to an access database and connects to a paradox database (directory)... I query an Access table and it returns the data I need...as the program begins. The operator selects a ...
VIEWS ON THIS POST

321

Posted on:

Tuesday 20th November 2012
View Replies!

Javascript, ODBC, and Oracle functions returning cursors

Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript to make ODBC calls to the ...
VIEWS ON THIS POST

202

Posted on:

Tuesday 20th November 2012
View Replies!